Sign in to follow this  
lpbr

Phaser.Game coordinates

Recommended Posts

There is a way to move the game stage or it's permanently locked to 0,0?

I would like to be able to set its x,y like this...

var game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.AUTO, 'test', { preload: preload, create: create });
game.x = 10;
game.y = 10;

Is this possible?

PS: I tested the above and obviously it didn't work. I checked documentation and see that there is no x,y properties available for Game class but I was wondering if there is any hack. I can recalculate all my assets coordinates to achieve the result but it would be too much simpler if I could just move the game stage around...

Thanks!

Share this post


Link to post
Share on other sites

You can move the game.world, but not the game directly. I'm always putting all my gameObjects in Groups, so this is rarely a problem for me (then I can move the ui and game independently), but that should work.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.