Jump to content

Phaser Pointer problem in large world


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 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...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...