2013-10-01 12:54:29 +00:00
|
|
|
/**
|
|
|
|
* @author Richard Davey <rich@photonstorm.com>
|
2014-02-05 05:54:25 +00:00
|
|
|
* @copyright 2014 Photon Storm Ltd.
|
2013-10-01 12:54:29 +00:00
|
|
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2013-11-13 06:49:24 +00:00
|
|
|
* A RenderTexture is a special texture that allows any displayObject to be rendered to it.
|
2013-10-01 12:54:29 +00:00
|
|
|
* @class Phaser.RenderTexture
|
|
|
|
* @constructor
|
|
|
|
* @param {Phaser.Game} game - Current game instance.
|
2013-10-25 14:22:45 +00:00
|
|
|
* @param {string} key - Asset key for the render texture.
|
|
|
|
* @param {number} width - the width of the render texture.
|
|
|
|
* @param {number} height - the height of the render texture.
|
2013-10-01 12:54:29 +00:00
|
|
|
*/
|
2013-09-11 01:57:36 +00:00
|
|
|
Phaser.RenderTexture = function (game, key, width, height) {
|
2013-09-10 00:26:50 +00:00
|
|
|
|
2013-11-25 03:13:04 +00:00
|
|
|
/**
|
|
|
|
* @property {Phaser.Game} game - A reference to the currently running game.
|
|
|
|
*/
|
|
|
|
this.game = game;
|
2013-09-10 00:26:50 +00:00
|
|
|
|
2013-11-25 03:13:04 +00:00
|
|
|
/**
|
2013-10-25 14:22:45 +00:00
|
|
|
* @property {string} name - the name of the object.
|
2013-11-25 03:13:04 +00:00
|
|
|
*/
|
2013-09-11 01:57:36 +00:00
|
|
|
this.name = key;
|
|
|
|
|
2013-11-25 03:13:04 +00:00
|
|
|
/**
|
|
|
|
* @property {number} width - the width.
|
2013-10-01 12:54:29 +00:00
|
|
|
*/
|
2013-11-25 03:13:04 +00:00
|
|
|
this.width = width || 100;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @property {number} height - the height.
|
2013-10-01 12:54:29 +00:00
|
|
|
*/
|
2013-11-25 03:13:04 +00:00
|
|
|
this.height = height || 100;
|
2013-09-10 00:26:50 +00:00
|
|
|
|
2013-11-25 03:13:04 +00:00
|
|
|
/**
|
|
|
|
* @property {PIXI.Rectangle} frame - The frame for this texture.
|
2013-10-01 12:54:29 +00:00
|
|
|
*/
|
2013-11-25 03:13:04 +00:00
|
|
|
this.frame = new PIXI.Rectangle(0, 0, this.width, this.height);
|
2013-09-10 00:26:50 +00:00
|
|
|
|
2013-11-25 03:13:04 +00:00
|
|
|
/**
|
|
|
|
* @property {number} type - Base Phaser object type.
|
2013-10-01 12:54:29 +00:00
|
|
|
*/
|
2013-11-25 03:13:04 +00:00
|
|
|
this.type = Phaser.RENDERTEXTURE;
|
|
|
|
|
2014-02-07 02:31:29 +00:00
|
|
|
// this._tempPoint = { x: 0, y: 0 };
|
2013-11-25 03:13:04 +00:00
|
|
|
|
2014-02-07 02:31:29 +00:00
|
|
|
// if (PIXI.gl)
|
|
|
|
// {
|
|
|
|
// this.initWebGL();
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// this.initCanvas();
|
|
|
|
// }
|
2013-11-25 03:13:04 +00:00
|
|
|
|
2013-09-10 00:26:50 +00:00
|
|
|
};
|
|
|
|
|
2014-02-07 02:31:29 +00:00
|
|
|
Phaser.RenderTexture.prototype = Object.create(PIXI.RenderTexture.prototype);
|
|
|
|
Phaser.RenderTexture.prototype.constructor = Phaser.RenderTexture;
|
2013-11-13 06:49:24 +00:00
|
|
|
|