File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1052,14 +1052,20 @@ Phaser.Physics.Arcade.Body.prototype = {
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 *
1055+ * If you've scaled a Sprite by altering its `width`, `height`, or `scale` and you want to
1056+ * position the Body relative to the Sprite's dimensions (which will differ from its texture's
1057+ * dimensions), you should divide these arguments by the Sprite's current scale:
1058+ *
1059+ * `setSize(32 / sprite.scale.x, 32 / sprite.scale.y)`
1060+ *
10551061 * Calling `setSize` on a Body that has already had `setCircle` will reset all of the Circle
10561062 * properties, making this Body rectangular again.
10571063 *
10581064 * @method Phaser.Physics.Arcade.Body#setSize
10591065 * @param {number } width - The width of the Body.
10601066 * @param {number } height - The height of the Body.
1061- * @param {number } [offsetX] - The X offset of the Body from the top-left of the Sprites texture.
1062- * @param {number } [offsetY] - The Y offset of the Body from the top-left of the Sprites texture.
1067+ * @param {number } [offsetX] - The X offset of the Body from the top-left of the Sprite's texture.
1068+ * @param {number } [offsetY] - The Y offset of the Body from the top-left of the Sprite's texture.
10631069 */
10641070 setSize : function ( width , height , offsetX , offsetY ) {
10651071
You can’t perform that action at this time.
0 commit comments