Jump to content

Phaser Pointer problem in large world


CharlesCraft50
 Share

Recommended Posts

One common problem is that if you don't fix a sprite to the camera object in Phaser, the sprite will be positioned to the coordinates of the world, not the screen. For example, if the pointer is at position 480,360, that is where the sun will be positioned in the world. You need to position the sun relative to the game screen, not the game world.

Try adding this line after where you create the sun sprite:

sun_sprite.fixedToCamera = true; 

The same thing should apply to the shadow sprite as well.

See this example for more information.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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