Phaser.TileSprite = function (game, x, y, width, height, key){ x = x || 0; y = y || 0; width = width || 256; height = height || 256; key = key || null ; Phaser.Sprite.call(this, game, x, y, key); this.texture = PIXI.TextureCache[key]; PIXI.TilingSprite.call(this, this.texture, width, height); this.type = Phaser.TILESPRITE; this.tileScale = new Phaser.Point(1, 1); this.tilePosition = new Phaser.Point(0, 0); this.body.width = width; this.body.height = height; } ; Phaser.TileSprite.prototype = Phaser.Utils.extend(true , PIXI.TilingSprite.prototype, Phaser.Sprite.prototype); Phaser.TileSprite.prototype.constructor = Phaser.TileSprite; Object.defineProperty(Phaser.TileSprite.prototype, 'angle', { get: function (){ return Phaser.Math.wrapAngle(Phaser.Math.radToDeg(this.rotation)); } , set: function (value){ this.rotation = Phaser.Math.degToRad(Phaser.Math.wrapAngle(value)); } } ); Object.defineProperty(Phaser.TileSprite.prototype, "frame", { get: function (){ return this.animations.frame; } , set: function (value){ this.animations.frame = value; } } ); Object.defineProperty(Phaser.TileSprite.prototype, "frameName", { get: function (){ return this.animations.frameName; } , set: function (value){ this.animations.frameName = value; } } ); Object.defineProperty(Phaser.TileSprite.prototype, "inCamera", { get: function (){ return this._cache.cameraVisible; } } ); Object.defineProperty(Phaser.TileSprite.prototype, "inputEnabled", { get: function (){ return (this.input.enabled); } , set: function (value){ if (value) { if (this.input.enabled === false ) { this.input.start(); } } else { if (this.input.enabled) { this.input.stop(); } } } } );