I’m trying to learn how to use the Game Scaling/Resizing Example (v3) but I’m not sure how to apply it to my existing game. I currently have two canvas elements. The one that is resizing is empty and the one that has all my objects is below it.
I have a hunch new Phaser.Game(config) is it but I don’t know how to change the code so that it works with my existing game.
var game = new Phaser.Game(config);
game.scene.add('Boot', MyGame.Boot, true);
//code below belongs to resizing/scaling example. Code above is what I originally added to my game.
window.addEventListener('load', () => {
const game = new Phaser.Game(config)....
Okay thanks I did that but I’m using a function that reassigns colors in my spritesheet and I’m getting “game is not defined” on lines where ‘game’ is used in that function.
This is one of the drawbacks when you are using someone else’s code.