I am developing a game where I need to zoom in entire map also I can be able zoom out. I have created a tilemap using tiled software and rendered it using phaser.js. How can I add this function to my game?


1 Answer 1


First you need to setup your camera like this:

this.camera = this.cameras.main.setBounds(0, 0, 640, 340);

// make the camera follow the player  

// set background color, so the sky is not black  

And you can set up the zoom like this:

2, //zoom distance   
1000 // duration/speed of zoom

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .