Sprite#fixedToCamera

fixedToCamera : boolean

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.

The values are adjusted at the rendering stage, overriding the Game Objects actual world position.

The end result is that the Game Object will appear to be 'fixed' to the camera, regardless of where in the game world
the camera is viewing. This is useful if for example this Game Object is a UI item that you wish to be visible at all times
regardless where in the world the camera is.

The offsets are stored in the cameraOffset property.

Note that the cameraOffset values are in addition to any parent of this Game Object on the display list.

Be careful not to set fixedToCamera on Game Objects which are in Groups that already have fixedToCamera enabled on them.

Inherited From
Source code: gameobjects/components/FixedToCamera.js (Line 56)
doc_phaser
2017-02-14 11:10:32
Comments
Leave a Comment

Please login to continue.