Skip to content

Commit 0eef6f1

Browse files
committed
Updated scroll factor docs to clarify impact on physics bodies phaserjs#3810
1 parent f70b4f8 commit 0eef6f1

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ Setting the `resolution` property in the Game Config to a value other than 1 wou
190190

191191
My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs:
192192

193-
@SBCGames @rgk @rook2pawn @robbintt @bguyl @halilcakarr @PhaserEditor2D @Edwin222 @tfelix @Yudikubota @hexus @guzmonne @ampled @thanh-taro @dcbriccetti @Dreaded-Gnu @padme-amidala @rootasjey @ampled @thejonanshow @polarstoat
193+
@SBCGames @rgk @rook2pawn @robbintt @bguyl @halilcakarr @PhaserEditor2D @Edwin222 @tfelix @Yudikubota @hexus @guzmonne @ampled @thanh-taro @dcbriccetti @Dreaded-Gnu @padme-amidala @rootasjey @ampled @thejonanshow @polarstoat @jdjoshuadavison
194194

195195
Thanks to @khaleb85 for fixing the super-annoying lag on the API Docs pages when it hung the browser while indexing the search field.
196196

src/gameobjects/components/ScrollFactor.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ var ScrollFactor = {
2424
* A value of 1 means it will move exactly in sync with a camera.
2525
* A value of 0 means it will not move at all, even if the camera moves.
2626
* Other values control the degree to which the camera movement is mapped to this Game Object.
27+
*
28+
* Please be aware that scroll factor values other than 1 are not taken in to consideration when
29+
* calculating physics collisions. Bodies always collide based on their world position, but changing
30+
* the scroll factor is a visual adjustment to where the textures are rendered, which can offset
31+
* them from physics bodies if not accounted for in your code.
2732
*
2833
* @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX
2934
* @type {number}
@@ -43,6 +48,11 @@ var ScrollFactor = {
4348
* A value of 1 means it will move exactly in sync with a camera.
4449
* A value of 0 means it will not move at all, even if the camera moves.
4550
* Other values control the degree to which the camera movement is mapped to this Game Object.
51+
*
52+
* Please be aware that scroll factor values other than 1 are not taken in to consideration when
53+
* calculating physics collisions. Bodies always collide based on their world position, but changing
54+
* the scroll factor is a visual adjustment to where the textures are rendered, which can offset
55+
* them from physics bodies if not accounted for in your code.
4656
*
4757
* @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY
4858
* @type {number}
@@ -62,6 +72,11 @@ var ScrollFactor = {
6272
* A value of 1 means it will move exactly in sync with a camera.
6373
* A value of 0 means it will not move at all, even if the camera moves.
6474
* Other values control the degree to which the camera movement is mapped to this Game Object.
75+
*
76+
* Please be aware that scroll factor values other than 1 are not taken in to consideration when
77+
* calculating physics collisions. Bodies always collide based on their world position, but changing
78+
* the scroll factor is a visual adjustment to where the textures are rendered, which can offset
79+
* them from physics bodies if not accounted for in your code.
6580
*
6681
* @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor
6782
* @since 3.0.0

0 commit comments

Comments
 (0)