File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1072,6 +1072,7 @@ var Body = new Class({
10721072 /**
10731073 * Sizes and positions this Body's boundary, as a rectangle.
10741074 * Modifies the Body's `offset` if `center` is true (the default).
1075+ * Resets the width and height to match current frame, if no width and height provided.
10751076 *
10761077 * @method Phaser.Physics.Arcade.Body#setSize
10771078 * @since 3.0.0
@@ -1088,6 +1089,9 @@ var Body = new Class({
10881089
10891090 var gameObject = this . gameObject ;
10901091
1092+ if ( width === undefined ) { width = gameObject . frame . data . sourceSize . w ; }
1093+ if ( height === undefined ) { height = gameObject . frame . data . sourceSize . h ; }
1094+
10911095 this . sourceWidth = width ;
10921096 this . sourceHeight = height ;
10931097
Original file line number Diff line number Diff line change @@ -486,7 +486,8 @@ var StaticBody = new Class({
486486 } ,
487487
488488 /**
489- * [description]
489+ * Sets the size of the body.
490+ * Resets the body to match the current frame if no width or height is provided.
490491 *
491492 * @method Phaser.Physics.Arcade.StaticBody#setSize
492493 * @since 3.0.0
@@ -500,6 +501,8 @@ var StaticBody = new Class({
500501 */
501502 setSize : function ( width , height , offsetX , offsetY )
502503 {
504+ if ( width === undefined ) { width = this . gameObject . frame . data . sourceSize . w ; }
505+ if ( height === undefined ) { height = this . gameObject . frame . data . sourceSize . h ; }
503506 if ( offsetX === undefined ) { offsetX = this . offset . x ; }
504507 if ( offsetY === undefined ) { offsetY = this . offset . y ; }
505508
You can’t perform that action at this time.
0 commit comments