PaulB-H / breakout

Breakout made with Phaser
https://paulbh.com/breakout
3 stars 0 forks source link

Bitmap font text looks broken at different font sizes / zoom levels #8

Closed PaulB-H closed 5 months ago

PaulB-H commented 10 months ago

Broken

image

Smooth:

image

PaulB-H commented 5 months ago

This can be fixed by using: game.scale.displaySize.setSnap(pixelWidth, pixelHeight);

However, this can lead to black bars / border depending on resolution.

It ensures the game canvas can only resize to am even multiple of your set width/height, preventing sprites from becoming skewed.

See:

https://phaser.discourse.group/t/scale-game-to-fit-with-snapping-phaser-3/6532

https://newdocs.phaser.io/docs/3.55.2/focus/Phaser.Structs.Size-setSnap

I don't really want to implement this here, because due to my dimensions this snap adds too much border around the game, and the game window too small.