Jump to content

Changing world position


Ahmed Khalifa
 Share

Recommended Posts

Hello everyone,

I am trying to make the screen scale automatically based on the browser window. So I used the scale variable in world to scale it. I was trying to center it so I used the following code:

this.world.x = Math.floor((this.game.width - Global.SCALE * Global.WIDTH) / 2);
this.world.y = Math.floor((this.game.height - Global.SCALE * Global.HEIGHT) / 2);

which didn't work nothing on the screen moved, I tried world.position.x/world.position.y and world.left/world.top and still nothing changed. Any help?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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