Scaling HTML5 Games for Browsers
HTML5 browser games are well-known to scale easily with different browser dimensions. But how do we scale game art for browser dimensions?
Game art scaling can be done using 4 methods:
- Fixed game size – game size stays fixed even when the browser size keeps changing
- Game size based on device pixel ratio – the canvas’s width and height is set to a multiple of the game’s width and height
- Set game scaling – set the game canvas width and height to the size of the browser, not on the fixed game size
- Set game scaling – The game is zoomed in based on the browser and the game size, there will be unseen parts
To see these methods in action, read the rest of the article here.