Skip to content

Commit aebce8a

Browse files
committed
Add Phaser.GameObjects.TileSprite#setTilePosition
Both arguments are optional.
1 parent 935a893 commit aebce8a

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

src/gameobjects/tilesprite/TileSprite.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,32 @@ var TileSprite = new Class({
188188
}, this);
189189
},
190190

191+
/**
192+
* Sets {@link Phaser.GameObjects.TileSprite#tilePositionX} and {@link Phaser.GameObjects.TileSprite#tilePositionY}.
193+
*
194+
* @method Phaser.GameObjects.TileSprite#setTilePosition
195+
* @since [version]
196+
*
197+
* @param {number} [x] - The x position of this sprite's tiling texture.
198+
* @param {number} [y] - The y position of this sprite's tiling texture.
199+
*
200+
* @return {Phaser.GameObjects.TileSprite} This Tile Sprite instance.
201+
*/
202+
setTilePosition: function (x, y)
203+
{
204+
if (x !== undefined)
205+
{
206+
this.tilePositionX = x;
207+
}
208+
209+
if (y !== undefined)
210+
{
211+
this.tilePositionY = y;
212+
}
213+
214+
return this;
215+
},
216+
191217
/**
192218
* [description]
193219
*

0 commit comments

Comments
 (0)