forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRenderTexture.js
More file actions
70 lines (58 loc) · 1.69 KB
/
Copy pathRenderTexture.js
File metadata and controls
70 lines (58 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
* @module Phaser.RenderTexture
*/
/**
* Description of constructor.
* @class Phaser.RenderTexture
* @classdesc Description of class.
* @constructor
* @param {Phaser.Game} game - Current game instance.
* @param {string} key - Description.
* @param {number} width - Description.
* @param {number} height - Description.
*/
Phaser.RenderTexture = function (game, key, width, height) {
/**
* @property {Phaser.Game} game - A reference to the currently running game.
*/
this.game = game;
/**
* @property {Description} name - Description.
*/
this.name = key;
PIXI.EventTarget.call( this );
/**
* @property {number} width - Description.
*/
this.width = width || 100;
/**
* @property {number} height - Description.
*/
this.height = height || 100;
/** 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 :)
* @property {Description} indetityMatrix - Description.
*/
this.indetityMatrix = PIXI.mat3.create();
/**
* @property {Description} frame - Description.
*/
this.frame = new PIXI.Rectangle(0, 0, this.width, this.height);
/**
* @property {Description} type - Description.
*/
this.type = Phaser.RENDERTEXTURE;
if (PIXI.gl)
{
this.initWebGL();
}
else
{
this.initCanvas();
}
};
Phaser.RenderTexture.prototype = Phaser.Utils.extend(true, PIXI.RenderTexture.prototype);
Phaser.RenderTexture.prototype.constructor = Phaser.RenderTexture;