Phaser.BitmapText = function (game, x, y, font, text, size){ x = x || 0; y = y || 0; font = font || ''; text = text || ''; size = size || 32; this.game = game; this.exists = true ; this.name = ''; this.type = Phaser.BITMAPTEXT; this.world = new Phaser.Point(x, y); this.fixedToCamera = false ; this._text = text; this._font = font; this._fontSize = size; this._align = 'left'; this._tint = 16777215; this.events = new Phaser.Events(this); this.input = null ; PIXI.BitmapText.call(this, text); this.position.set(x, y); } ; Phaser.BitmapText.prototype = Object.create(PIXI.BitmapText.prototype); Phaser.BitmapText.prototype.constructor = Phaser.BitmapText; Phaser.BitmapText.prototype.setStyle = function (){ this.style = { align: this._align} ; this.fontName = this._font; this.fontSize = this._fontSize; this.dirty = true ; } ; Phaser.BitmapText.prototype.preUpdate = function (){ if (!this.exists || !this.parent.exists) { return false ; } this.world.setTo(this.game.camera.x + this.worldTransform.tx, this.game.camera.y + this.worldTransform.ty); } ; Phaser.BitmapText.prototype.update = function (){ } ; Phaser.BitmapText.prototype.postUpdate = function (){ if (this.exists) { if (this.fixedToCamera) { } } } ; Phaser.BitmapText.prototype.destroy = function (){ if (this.filters) { this.filters = null ; } if (this.parent) { this.parent.remove(this); } this.exists = false ; this.visible = false ; this.game = null ; if (_AN_Read_length('length', this.children) > 0) { do { this.removeChild(this.children[0]); } while(_AN_Read_length('length', this.children) > 0)} } ; Object.defineProperty(Phaser.BitmapText.prototype, 'align', { get: function (){ return this._align; } , set: function (value){ if (value !== this._align) { this._align = value; this.setStyle(); } } } ); Object.defineProperty(Phaser.BitmapText.prototype, 'tint', { get: function (){ return this._tint; } , set: function (value){ if (value !== this._tint) { this._tint = value; this.dirty = true ; } } } ); Object.defineProperty(Phaser.BitmapText.prototype, 'angle', { get: function (){ return Phaser.Math.radToDeg(this.rotation); } , set: function (value){ this.rotation = Phaser.Math.degToRad(value); } } ); Object.defineProperty(Phaser.BitmapText.prototype, 'font', { get: function (){ return this._font; } , set: function (value){ if (value !== this._font) { this._font = value.trim(); this.style.font = this._fontSize + "px '" + this._font + "'"; this.dirty = true ; } } } ); Object.defineProperty(Phaser.BitmapText.prototype, 'fontSize', { get: function (){ return this._fontSize; } , set: function (value){ value = parseInt(value); if (value !== this._fontSize) { this._fontSize = value; this.style.font = this._fontSize + "px '" + this._font + "'"; this.dirty = true ; } } } ); Object.defineProperty(Phaser.BitmapText.prototype, 'text', { get: function (){ return this._text; } , set: function (value){ if (value !== this._text) { this._text = value.toString() || ' '; this.dirty = true ; } } } ); Object.defineProperty(Phaser.BitmapText.prototype, "inputEnabled", { get: function (){ return (this.input && this.input.enabled); } , set: function (value){ if (value) { if (this.input === null ) { this.input = new Phaser.InputHandler(this); this.input.start(); } } else { if (this.input && this.input.enabled) { this.input.stop(); } } } } );