Skip to content

Commit 42ca43d

Browse files
author
James
authored
updated docs on Arcade body's setSize
1 parent 99f0fb6 commit 42ca43d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/physics/arcade/Body.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,9 +1046,9 @@ Phaser.Physics.Arcade.Body.prototype = {
10461046
* For example: If you have a Sprite with a texture that is 80x100 in size,
10471047
* and you want the physics body to be 32x32 pixels in the middle of the texture, you would do:
10481048
*
1049-
* `setSize(32, 32, 24, 34)`
1049+
* `setSize(32 / Math.abs(this.scale.x), 32 / Math.abs(this.scale.y), 24, 34)`
10501050
*
1051-
* Where the first two parameters is the new Body size (32x32 pixels).
1051+
* Where the first two parameters are the new Body size (32x32 pixels) relative to the Sprite's scale.
10521052
* 24 is the horizontal offset of the Body from the top-left of the Sprites texture, and 34
10531053
* is the vertical offset.
10541054
*

0 commit comments

Comments
 (0)