Image Quality using zoom

Hi, how can I maintain the image quality using zoom on phaser? I tryed many ways and nothing seems to work. The code below shows with bitmap and nothing changes.

var config = {

type        : Phaser.CANVAS,

parent      : 'content',

width       : 400,

height      : 300,

zoom        : 3,

pixelArt    : true,

renderer: {

    mipmapFilter: 'LINEAR_MIPMAP_NEAREST'

},

physics     : {

    default : 'arcade',

    arcade  : {

        gravity : { y : 0},

        debug : true,

    }

},

scene : [

    BootScene,

    MenuScene,

    WorldScene,

   /* GameOver*/

]

};

var game = new Phaser.Game(config);

class MenuScene extends Phaser.Scene {

constructor() {

    super( { key: 'MenuScene' } );

}

preload() {}

create() {

    this.add.image(game.scale.width/ 2, game.scale.height / 2, 'background');

    this.menu =  this.add.image(game.scale.width/ 2, game.scale.height / 2, 'menu');

     

     this.buttonRestart = this.add.image(game.scale.width/ 2, 100, 'buttonRestart').setDisplaySize(128, 128).setInteractive({ useHandCursor: true });

    // this.buttonOptions = this.add.image(160, 200, 'buttonOptions').setScale(0.2).setInteractive({ useHandCursor: true });

    // this.buttonHelp = this.add.image(160, 200, 'buttonHelp').setScale(0.2).setInteractive({ useHandCursor: true });

    // this.buttonPlay = this.add.image(160, 200, 'buttonPlay').setScale(0.25).setInteractive({ useHandCursor: true });

   

    // // -- click no button

     this.buttonRestart.once('pointerdown', function (pointer) {

       

         this.scene.start('WorldScene');

    }, this);

}

}

The image looks like this, and i used vectors to make it, i have tried a lot of sizes, including downgrading to phazer 3.15 to use the defenition tool, but nothing seems to work.

Sooo, no one have an ideia how to do it?

Small dimensions (400 × 300) and a large zoom (3) won’t give sharp images.

It sounds like you want something more like { width: 1200, height: 900 }.

1 Like