Phaser.GameObject.Image = function (game, x, y, key, frame){ Phaser.Component.BaseTransform.call(this, x, y); this.game = game; this.type = Phaser.IMAGE; this.parent = null ; this.texture = game.textures.get(key); this.frame = this.texture.get(frame); this.children = new Phaser.Component.Children(this); this.skipRender = (key === undefined); this.visible = true ; this.data = new Phaser.Component.Data(this); this.alpha = 1; this.blendMode = Phaser.blendModes.NORMAL; this.scaleMode = Phaser.scaleModes.DEFAULT; this.exists = true ; } ; Phaser.GameObject.Image.prototype = Object.create(Phaser.Component.BaseTransform.prototype); Phaser.GameObject.Image.prototype.constructor = Phaser.GameObject.Image; Phaser.GameObject.Image.prototype.preUpdate = function (){ this.transform.update(); } ; Phaser.GameObject.Image.prototype.update = function (){ } ; Phaser.GameObject.Image.prototype.postUpdate = function (){ } ; Object.defineProperties(Phaser.GameObject.Image.prototype, { width: { enumerable: true , get: function (){ return this.transform._scaleX * this.frame.realWidth; } , set: function (value){ this.scaleX = value / this.frame.realWidth; } } , height: { enumerable: true , get: function (){ return this.transform._scaleY * this.frame.realHeight; } , set: function (value){ this.scaleY = value / this.frame.realHeight; } } } );