Phaser.BitmapData = function (game, key, width, height){ if (typeof key === 'undefined') { key = 'bitmapData'.game.rnd.uuid(); } if (typeof width === 'undefined') { width = 256; } if (typeof height === 'undefined') { height = 256; } this.game = game; this.name = key; this.width = width; this.height = height; this.canvas = Phaser.Canvas.create(width, height); this.context = this.canvas.getContext('2d'); this.baseTexture = new PIXI.BaseTexture(this.canvas); this.texture = new PIXI.Texture(this.baseTexture); this.textureFrame = new Phaser.Frame(0, 0, 0, width, height, 'bitmapData', game.rnd.uuid()); this.type = Phaser.BITMAPDATA; } ; Phaser.BitmapData.prototype = { clear: function (){ this.context.clearRect(0, 0, this.width, this.height); } , render: function (){ if (this.game.renderType == Phaser.WEBGL) { PIXI.texturesToUpdate.push(this.baseTexture); } } } ;