Skip to content

Commit 88f10f7

Browse files
committed
Updated fixedToCamera docs to reflect non-nesting (phaserjs#1596)
1 parent b0261e4 commit 88f10f7

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/core/Group.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ Phaser.Group = function (game, parent, name, addToStage, enableBody, physicsBody
174174

175175
/**
176176
* If this object is {@link #fixedToCamera} then this stores the x/y position offset relative to the top-left of the camera view.
177+
* If the parent of this Group is also `fixedToCamera` then the offset here is in addition to that and should typically be disabled.
177178
* @property {Phaser.Point} cameraOffset
178179
*/
179180
this.cameraOffset = new Phaser.Point();

src/gameobjects/components/FixedToCamera.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Phaser.Component.FixedToCamera.prototype = {
1616
* A Sprite that is fixed to the camera uses its x/y coordinates as offsets from the top left of the camera. These are stored in Sprite.cameraOffset.
1717
* Note that the cameraOffset values are in addition to any parent in the display list.
1818
* So if this Sprite was in a Group that has x: 200, then this will be added to the cameraOffset.x
19+
* Be careful not to set `fixedToCamera` on Game Objects which are in Groups that already have fixedToCamera enabled on them.
1920
* @property {boolean} fixedToCamera
2021
*/
2122
fixedToCamera: false,

0 commit comments

Comments
 (0)