2013-09-03 02:19:42 +00:00
|
|
|
Phaser.TileSprite = function (game, x, y, width, height, key, frame) {
|
|
|
|
|
|
|
|
x = x || 0;
|
|
|
|
y = y || 0;
|
|
|
|
width = width || 256;
|
|
|
|
height = height || 256;
|
|
|
|
key = key || null;
|
|
|
|
frame = frame || null;
|
|
|
|
|
2013-09-03 03:58:30 +00:00
|
|
|
Phaser.Sprite.call(this, game, x, y, key, frame);
|
2013-09-03 02:19:42 +00:00
|
|
|
|
2013-09-03 03:58:30 +00:00
|
|
|
this.texture = PIXI.TextureCache[key];
|
2013-09-03 02:19:42 +00:00
|
|
|
|
2013-09-03 05:02:47 +00:00
|
|
|
PIXI.TilingSprite.call(this, this.texture, width, height);
|
2013-09-03 02:19:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The scaling of the image that is being tiled
|
|
|
|
*
|
|
|
|
* @property tileScale
|
|
|
|
* @type Point
|
|
|
|
*/
|
2013-09-03 05:02:47 +00:00
|
|
|
this.tileScale = new Phaser.Point(1, 1);
|
2013-09-03 02:19:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The offset position of the image that is being tiled
|
|
|
|
*
|
|
|
|
* @property tilePosition
|
|
|
|
* @type Point
|
|
|
|
*/
|
2013-09-03 05:02:47 +00:00
|
|
|
this.tilePosition = new Phaser.Point(0, 0);
|
2013-09-03 02:19:42 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2013-09-03 03:58:30 +00:00
|
|
|
Phaser.TileSprite.prototype = Phaser.Utils.extend(true, PIXI.TilingSprite.prototype, Phaser.Sprite.prototype);
|
2013-09-03 02:19:42 +00:00
|
|
|
Phaser.TileSprite.prototype.constructor = Phaser.TileSprite;
|
|
|
|
|
2013-09-03 03:58:30 +00:00
|
|
|
// Add our own custom methods
|