2013-09-11 01:57:36 +00:00
|
|
|
Phaser.RenderTexture = function (game, key, width, height) {
|
2013-09-10 00:26:50 +00:00
|
|
|
|
|
|
|
this.game = game;
|
|
|
|
|
2013-09-11 01:57:36 +00:00
|
|
|
this.name = key;
|
|
|
|
|
2013-09-10 00:26:50 +00:00
|
|
|
PIXI.EventTarget.call( this );
|
|
|
|
|
|
|
|
this.width = width || 100;
|
|
|
|
this.height = height || 100;
|
|
|
|
|
2013-09-19 12:33:51 +00:00
|
|
|
// I know this has a typo in it, but it's because the PIXI.RenderTexture does and we need to pair-up with it
|
|
|
|
// once they update pixi to fix the typo, we'll fix it here too :)
|
|
|
|
this.indetityMatrix = PIXI.mat3.create();
|
2013-09-10 00:26:50 +00:00
|
|
|
|
|
|
|
this.frame = new PIXI.Rectangle(0, 0, this.width, this.height);
|
|
|
|
|
2013-09-12 20:54:41 +00:00
|
|
|
this.type = Phaser.RENDERTEXTURE;
|
|
|
|
|
2013-09-10 00:26:50 +00:00
|
|
|
if (PIXI.gl)
|
|
|
|
{
|
|
|
|
this.initWebGL();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
this.initCanvas();
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
Phaser.RenderTexture.prototype = Phaser.Utils.extend(true, PIXI.RenderTexture.prototype);
|
|
|
|
Phaser.RenderTexture.prototype.constructor = Phaser.RenderTexture;
|