Lucky Posted May 21, 2014 Share Posted May 21, 2014 I have seen it in the exaples but cannot fint it again.How do I atutomaticly center the camera without manualy caculate the game bounds. /Lukas Link to comment Share on other sites More sharing options...
j0hnskot Posted May 21, 2014 Share Posted May 21, 2014 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 More sharing options...
Heppell08 Posted May 21, 2014 Share Posted May 21, 2014 If you want to center it on a sprite then call;game.camera.follow(sprite, Phaser.Camera.FOLLOW_LOCKON); Link to comment Share on other sites More sharing options...
Lucky Posted May 21, 2014 Author Share Posted May 21, 2014 Thanks guys I appreciate works perfect j0hnskot whats the differance ongame.camera.follow(sprite, Phaser.Camera.FOLLOW_LOCKON);game.camera.follow(sprite); do you know Heppell08? Link to comment Share on other sites More sharing options...
CtlAltDel Posted May 21, 2014 Share Posted May 21, 2014 nothing. the default is lockon. Link to comment Share on other sites More sharing options...
Recommended Posts