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; Phaser.Sprite.call(this, game, x, y, key, frame); PIXI.TilingSprite.call(this); this.texture = PIXI.TextureCache[key]; /** * The width of the tiling sprite * * @property width * @type Number */ this.width = width; /** * The height of the tiling sprite * * @property height * @type Number */ this.height = height; /** * The scaling of the image that is being tiled * * @property tileScale * @type Point */ this.tileScale = new Phaser.Point(1,1); /** * The offset position of the image that is being tiled * * @property tilePosition * @type Point */ this.tilePosition = new Phaser.Point(0,0); }; // Extend Phaser.Sprite and PIXI.TilingSprite Phaser.TileSprite.prototype = Phaser.Utils.extend(true, PIXI.TilingSprite.prototype, Phaser.Sprite.prototype); Phaser.TileSprite.prototype.constructor = Phaser.TileSprite; // Add our own custom methods