2
0
Fork 0
mirror of https://github.com/photonstorm/phaser synced 2024-12-18 17:16:03 +00:00
phaser/src/gameobjects/RenderTexture.js

64 lines
1.6 KiB
JavaScript
Raw Normal View History

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}
*/
/**
* 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.
* @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
*/
Phaser.RenderTexture = function (game, key, width, height) {
/**
* @property {Phaser.Game} game - A reference to the currently running game.
*/
this.game = game;
/**
* @property {string} name - the name of the object.
*/
this.name = key;
/**
* @property {number} width - the width.
2013-10-01 12:54:29 +00:00
*/
this.width = width || 100;
/**
* @property {number} height - the height.
2013-10-01 12:54:29 +00:00
*/
this.height = height || 100;
/**
* @property {PIXI.Rectangle} frame - The frame for this texture.
2013-10-01 12:54:29 +00:00
*/
this.frame = new PIXI.Rectangle(0, 0, this.width, this.height);
/**
* @property {number} type - Base Phaser object type.
2013-10-01 12:54:29 +00:00
*/
this.type = Phaser.RENDERTEXTURE;
// this._tempPoint = { x: 0, y: 0 };
// if (PIXI.gl)
// {
// this.initWebGL();
// }
// else
// {
// this.initCanvas();
// }
};
Phaser.RenderTexture.prototype = Object.create(PIXI.RenderTexture.prototype);
Phaser.RenderTexture.prototype.constructor = Phaser.RenderTexture;