Skip to content

Commit eb38ae3

Browse files
committed
renderXY added back into RenderTexture.
1 parent a61d030 commit eb38ae3

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

src/gameobjects/RenderTexture.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,51 @@ Phaser.RenderTexture = function (game, width, height, key) {
3030
*/
3131
this.type = Phaser.RENDERTEXTURE;
3232

33+
/**
34+
* @property {Phaser.Point} _temp - Internal var.
35+
* @private
36+
*/
37+
this._temp = new Phaser.Point();
38+
3339
PIXI.RenderTexture.call(this, width, height);
3440

3541
};
3642

3743
Phaser.RenderTexture.prototype = Object.create(PIXI.RenderTexture.prototype);
3844
Phaser.RenderTexture.prototype.constructor = Phaser.RenderTexture;
45+
46+
/**
47+
* This function will draw the display object to the texture.
48+
*
49+
* @method Phaser.RenderTexture.prototype.renderXY
50+
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapText|Phaser.Group} displayObject The display object to render to this texture.
51+
* @param {number} x - The x position to render the object at.
52+
* @param {number} y - The y position to render the object at.
53+
* @param {boolean} clear - If true the texture will be cleared before the display object is drawn.
54+
*/
55+
Phaser.RenderTexture.prototype.renderXY = function (displayObject, x, y, clear) {
56+
57+
this._temp.set(x, y);
58+
59+
this.render(displayObject, this._temp, clear);
60+
61+
}
62+
63+
// Documentation stubs
64+
65+
/**
66+
* This function will draw the display object to the texture.
67+
*
68+
* @method Phaser.RenderTexture.prototype.render
69+
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapText|Phaser.Group} displayObject The display object to render to this texture.
70+
* @param {Phaser.Point} position - A Point object containing the position to render the display object at.
71+
* @param {boolean} clear - If true the texture will be cleared before the display object is drawn.
72+
*/
73+
74+
/**
75+
* Resize this RenderTexture to the given width and height.
76+
*
77+
* @method Phaser.RenderTexture.prototype.resize
78+
* @param {number} width - The new width of the RenderTexture.
79+
* @param {number} height - The new height of the RenderTexture.
80+
*/

0 commit comments

Comments
 (0)