Jump to content

s4m_ur4i
 Share

Recommended Posts

Is there a way to define the x/y = 0/0 Point in Phaser? I could not find anything on the forum / docu.

So everything is aligned from 0/0 - I want to set a padding of "300" around the whole game. (example)
So that the camera can freely move around. The game itself is centered. But there are also renderable object ins space like (-2590, 30)

Anyway of doing that?
I tried to set negative world bounds and to resize the world.
It does nothing at all.

Link to comment
Share on other sites

Hi, not completely sure about your problem, but this sets 0,0 coordinates into center of screen:

            // set world and camera
            this.world.setBounds(-this.game.width / 2, -this.game.height / 2, this.game.width, this.game.height);
            this.camera.focusOnXY(0, 0);

 It is good for single-screen game. If you need to scroll freely anywhere, then set this:

this.camera.bounds = null;

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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