From aebce8a6950b30fce3566761008e4bf8dd20f7a7 Mon Sep 17 00:00:00 2001 From: samme Date: Sat, 10 Mar 2018 11:41:22 -0800 Subject: [PATCH] Add Phaser.GameObjects.TileSprite#setTilePosition Both arguments are optional. --- src/gameobjects/tilesprite/TileSprite.js | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/gameobjects/tilesprite/TileSprite.js b/src/gameobjects/tilesprite/TileSprite.js index f227a4035..c508b5160 100644 --- a/src/gameobjects/tilesprite/TileSprite.js +++ b/src/gameobjects/tilesprite/TileSprite.js @@ -188,6 +188,32 @@ var TileSprite = new Class({ }, this); }, + /** + * Sets {@link Phaser.GameObjects.TileSprite#tilePositionX} and {@link Phaser.GameObjects.TileSprite#tilePositionY}. + * + * @method Phaser.GameObjects.TileSprite#setTilePosition + * @since [version] + * + * @param {number} [x] - The x position of this sprite's tiling texture. + * @param {number} [y] - The y position of this sprite's tiling texture. + * + * @return {Phaser.GameObjects.TileSprite} This Tile Sprite instance. + */ + setTilePosition: function (x, y) + { + if (x !== undefined) + { + this.tilePositionX = x; + } + + if (y !== undefined) + { + this.tilePositionY = y; + } + + return this; + }, + /** * [description] *