Closed musjj closed 9 months ago
This can be done with scale mode FIT (or similar) and scale.setSnap().
I can't remember if I've requested already, but I would like snap options in the scale config, e.g.,
new Phaser.Game({
pixelArt: true,
scale: {
mode: Phaser.Scale.FIT,
width: 320,
height: 200,
snap: { width: 320, height: 200 },
min: { width: 320, height: 200 },
}
});
Thanks, that works for me!
Ah but still, having it as a built-in option would be nice, so I'll keep this open.
Thank you for submitting this feature request. We have implemented this and the feature has been pushed to the master
branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.
https://photonstorm.github.io/phaser3-docs/Phaser.Scale.ScaleModes.html
A scaling mode that scales the canvas up by integer scales (x2, x3, etc.) to fit the target area would be useful for pixel-perfect games. Of course, it should not scale the canvas down if the target area is smaller than the canvas