Phaser.GameObject = function (game, x, y, texture, frame, parent){ this.game = game; this.name = ''; this.type = 0; this.parent = parent; this.texture = texture; this.frame = frame; this.transform = new Phaser.Component.Transform(this, x, y); this.data = new Phaser.Component.Data(this); this.color = new Phaser.Component.Color(this); this.scaleMode = Phaser.scaleModes.DEFAULT; this.skipRender = false ; this.visible = true ; this.children = null ; this.exists = true ; } ; Phaser.GameObject.prototype.constructor = Phaser.GameObject; Phaser.GameObject.prototype = { preUpdate: function (){ } , update: function (){ } , postUpdate: function (){ } , render: function (){ } , destroy: function (){ } } ; Object.defineProperties(Phaser.GameObject.prototype, { x: { enumerable: true , get: function (){ return this.transform._posX; } , set: function (value){ this.transform._posX = value; this.transform.dirty = true ; } } , y: { enumerable: true , get: function (){ return this.transform._posY; } , set: function (value){ this.transform._posY = value; this.transform.dirty = true ; } } , scale: { enumerable: true , get: function (){ return this.transform._scaleX; } , set: function (value){ this.transform._scaleX = value; this.transform._scaleY = value; this.transform.dirty = true ; this.transform.updateCache(); } } , scaleX: { enumerable: true , get: function (){ return this.transform._scaleX; } , set: function (value){ this.transform._scaleX = value; this.transform.dirty = true ; this.transform.updateCache(); } } , scaleY: { enumerable: true , get: function (){ return this.transform._scaleY; } , set: function (value){ this.transform._scaleY = value; this.transform.dirty = true ; this.transform.updateCache(); } } , anchor: { enumerable: true , get: function (){ return this.transform._anchorX; } , set: function (value){ this.transform.setAnchor(value); } } , anchorX: { enumerable: true , get: function (){ return this.transform._anchorX; } , set: function (value){ this.transform._anchorX = value; this.transform.dirty = true ; } } , anchorY: { enumerable: true , get: function (){ return this.transform._anchorY; } , set: function (value){ this.transform._anchorY = value; this.transform.dirty = true ; } } , pivotX: { enumerable: true , get: function (){ return this.transform._pivotX; } , set: function (value){ this.transform._pivotX = value; this.transform.dirty = true ; this.transform.updateCache(); } } , pivotY: { enumerable: true , get: function (){ return this.transform._pivotY; } , set: function (value){ this.transform._pivotY = value; this.transform.dirty = true ; this.transform.updateCache(); } } , angle: { enumerable: true , get: function (){ return Phaser.Math.wrapAngle(this.rotation * Phaser.Math.RAD_TO_DEG); } , set: function (value){ this.rotation = Phaser.Math.wrapAngle(value) * Phaser.Math.DEG_TO_RAD; } } , rotation: { enumerable: true , get: function (){ return this.transform._rotation; } , set: function (value){ if (this.transform._rotation === value) { return ; } this.transform._rotation = value; this.transform.dirty = true ; if (this.transform._rotation % Phaser.Math.PI2) { this.transform.cache.sr = Math.sin(this.transform._rotation); this.transform.cache.cr = Math.cos(this.transform._rotation); this.transform.updateCache(); this.transform.hasLocalRotation = true ; } else { this.transform.hasLocalRotation = false ; } } } , alpha: { enumerable: true , get: function (){ return this.color._alpha; } , set: function (value){ this.color.alpha = value; } } , blendMode: { enumerable: true , get: function (){ return this.color._blendMode; } , set: function (value){ this.color.blendMode = value; } } } );