File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -237,8 +237,8 @@ Phaser.GameObjectCreator.prototype = {
237237 * Creates a new Graphics object.
238238 *
239239 * @method Phaser.GameObjectCreator#graphics
240- * @param {number } x - X position of the new graphics object.
241- * @param {number } y - Y position of the new graphics object.
240+ * @param {number } [x=0] - X position of the new graphics object.
241+ * @param {number } [y=0] - Y position of the new graphics object.
242242 * @return {Phaser.Graphics } The newly created graphics object.
243243 */
244244 graphics : function ( x , y ) {
Original file line number Diff line number Diff line change 2121* @extends Phaser.Component.LifeSpan
2222* @extends Phaser.Component.PhysicsBody
2323* @extends Phaser.Component.Reset
24- * @param {Phaser.Game } game Current game instance.
25- * @param {number } x - X position of the new graphics object.
26- * @param {number } y - Y position of the new graphics object.
24+ * @param {Phaser.Game } game - Current game instance.
25+ * @param {number } [x=0] - X position of the new graphics object.
26+ * @param {number } [y=0] - Y position of the new graphics object.
2727*/
2828Phaser . Graphics = function ( game , x , y ) {
2929
30- x = x || 0 ;
31- y = y || 0 ;
30+ if ( typeof x === 'undefined' ) { x = 0 ; }
31+ if ( typeof y === 'undefined' ) { y = 0 ; }
3232
3333 /**
3434 * @property {number } type - The const type of this object.
You can’t perform that action at this time.
0 commit comments