Jump to content

How to center the camera


Lucky
 Share

Recommended Posts

I think that works. 

game.camera.x=game.width/2;game.camera.y=game.height/2;

But according to docs if the camera exceeds world bounds the value will get clamped.

 

If you want to place it in the middle of the world use game.world.width and game.world.height.

Link to comment
Share on other sites

Thanks guys I appreciate

 

works perfect j0hnskot

 

 

whats the differance on

game.camera.follow(sprite, Phaser.Camera.FOLLOW_LOCKON);

game.camera.follow(sprite);

 

do you know Heppell08?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...