Jump to content

fixedToCamera makes sprite unmovable, probably a bug?


Embair
 Share

Recommended Posts

Hi, Phaser beginner here. Just spent way too much time tracking down why updating sprites position shortly after it was first created didn't do anything. Turns out setting fixedToCamera=true on the sprite causes position changes to be (temporarily?...) ignored.

Sandbox example

Seems like a bug to me (or in case it isn't it should probably be mentioned in the fixedToCamera documentation).

Link to comment
Share on other sites

Ah I see, thanks. Still, that makes the current fixedToCamera documentation quite misleading IMHO. 

Quote

A Game Object that is "fixed" to the camera uses its x/y coordinates as offsets from the top left of the camera during rendering.

Probably should read something like

"A Game Object that is "fixed" is displayed at a specified offset from the top left of the camera during rendering. The offset can be modified through cameraOffset property, which is initialized with the current object coordinates."

The fact that the current coordinates are automatically copied into cameraOffset but further changes to them aren't is a rather nasty newbie trap if you ask me.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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