Scale Manager zoom (config.zoom
or config.scale.zoom
) is different from camera zoom. It’s more of a whole-canvas zoom.
If you want to use Scale Manager zoom, it could be
let config = {
// …
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH,
width: 256,
height: 192,
zoom: 4,
min: {
width: 185,
height: 90
},
max: {
width: 320,
height: 200
}
},
// …
};
If you don’t use Scale Manager zoom (and probably camera zoom instead) it would be
let config = {
// …
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH,
width: 1024,
height: 768,
min: {
width: 740,
height: 360
},
max: {
width: 1280,
height: 800
}
},
// …
};
then
this.cameras.main
.setZoom(4)
.setBounds(
0,
0,
this.map.widthInPixels,
this.map.heightInPixels
)
.centerToBounds()
// OR
.centerOn(X, Y)
;