Skip to content

Commit 639b916

Browse files
author
James
committed
updated docs on weapon's setBulletBodyOffset
1 parent 3c60528 commit 639b916

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/plugins/weapon/WeaponPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -979,9 +979,9 @@ Phaser.Weapon.prototype.fireAtXY = function (x, y) {
979979
* For example: If you have a Sprite with a texture that is 80x100 in size,
980980
* and you want the physics body to be 32x32 pixels in the middle of the texture, you would do:
981981
*
982-
* `setSize(32, 32, 24, 34)`
982+
* `setSize(32 / Math.abs(this.scale.x), 32 / Math.abs(this.scale.y), 24, 34)`
983983
*
984-
* Where the first two parameters is the new Body size (32x32 pixels).
984+
* Where the first two parameters are the new Body size (32x32 pixels) relative to the Sprite's scale.
985985
* 24 is the horizontal offset of the Body from the top-left of the Sprites texture, and 34
986986
* is the vertical offset.
987987
*

0 commit comments

Comments
 (0)