@@ -71,16 +71,19 @@ Phaser.RenderTexture.prototype.constructor = PIXI.RenderTexture;
7171/**
7272* This function will draw the display object to the texture. If the display object is a Group or has children it will
7373* draw all children as well.
74- *
75- * @method render
74+ *
75+ * @method Phaser.RenderTexture#render
76+ * @memberof Phaser.RenderTexture
7677* @param {DisplayObject } displayObject - The display object to render this texture on.
7778* @param {Phaser.Point } [position] - Where to draw the display object.
7879* @param {boolean } [clear=false] - If true the texture will be cleared before the displayObject is drawn.
80+ * @param {boolean } [renderHidden=false] - If true displayObjects that have their visible property set to false will still be rendered.
7981*/
80- Phaser . RenderTexture . prototype . render = function ( displayObject , position , clear ) {
82+ Phaser . RenderTexture . prototype . render = function ( displayObject , position , clear , renderHidden ) {
8183
8284 if ( typeof position === 'undefined' ) { position = false ; }
8385 if ( typeof clear === 'undefined' ) { clear = false ; }
86+ if ( typeof renderHidden === 'undefined' ) { renderHidden = false ; }
8487
8588 if ( displayObject instanceof Phaser . Group )
8689 {
@@ -89,11 +92,11 @@ Phaser.RenderTexture.prototype.render = function(displayObject, position, clear)
8992
9093 if ( PIXI . gl )
9194 {
92- this . renderWebGL ( displayObject , position , clear ) ;
95+ this . renderWebGL ( displayObject , position , clear , renderHidden ) ;
9396 }
9497 else
9598 {
96- this . renderCanvas ( displayObject , position , clear ) ;
99+ this . renderCanvas ( displayObject , position , clear , renderHidden ) ;
97100 }
98101
99102}
@@ -102,29 +105,32 @@ Phaser.RenderTexture.prototype.render = function(displayObject, position, clear)
102105* This function will draw the display object to the texture at the given x/y coordinates.
103106* If the display object is a Group or has children it will draw all children as well.
104107*
105- * @method renderXY
108+ * @method Phaser.RenderTexture#renderXY
109+ * @memberof Phaser.RenderTexture
106110* @param {DisplayObject } displayObject - The display object to render this texture on.
107111* @param {number } x - The x coordinate to draw the display object at.
108112* @param {number } y - The y coordinate to draw the display object at.
109113* @param {boolean } [clear=false] - If true the texture will be cleared before the displayObject is drawn.
114+ * @param {boolean } [renderHidden=false] - If true displayObjects that have their visible property set to false will still be rendered.
110115*/
111- Phaser . RenderTexture . prototype . renderXY = function ( displayObject , x , y , clear ) {
116+ Phaser . RenderTexture . prototype . renderXY = function ( displayObject , x , y , clear , renderHidden ) {
112117
113118 this . _tempPoint . x = x ;
114119 this . _tempPoint . y = y ;
115120
116- this . render ( displayObject , this . _tempPoint , clear ) ;
121+ this . render ( displayObject , this . _tempPoint , clear , renderHidden ) ;
117122
118123}
119124
120125/**
121- * Initializes the webgl data for this texture
122- *
123- * @method initWebGL
124- * @private
125- */
126- Phaser . RenderTexture . prototype . initWebGL = function ( )
127- {
126+ * Initializes the webgl data for this texture
127+ *
128+ * @method Phaser.RenderTexture#initWebGL
129+ * @memberof Phaser.RenderTexture
130+ * @private
131+ */
132+ Phaser . RenderTexture . prototype . initWebGL = function ( ) {
133+
128134 var gl = PIXI . gl ;
129135 this . glFramebuffer = gl . createFramebuffer ( ) ;
130136
@@ -160,7 +166,12 @@ Phaser.RenderTexture.prototype.initWebGL = function()
160166 // this.render = this.renderWebGL;
161167}
162168
163-
169+ /**
170+ * Resizes the RenderTexture.
171+ *
172+ * @method Phaser.RenderTexture#resize
173+ * @memberof Phaser.RenderTexture
174+ */
164175Phaser . RenderTexture . prototype . resize = function ( width , height )
165176{
166177
@@ -186,11 +197,12 @@ Phaser.RenderTexture.prototype.resize = function(width, height)
186197}
187198
188199/**
189- * Initializes the canvas data for this texture
190- *
191- * @method initCanvas
192- * @private
193- */
200+ * Initializes the canvas data for this texture
201+ *
202+ * @method Phaser.RenderTexture#initCanvas
203+ * @memberof Phaser.RenderTexture
204+ * @private
205+ */
194206Phaser . RenderTexture . prototype . initCanvas = function ( )
195207{
196208 this . renderer = new PIXI . CanvasRenderer ( this . width , this . height , null , 0 ) ;
@@ -202,14 +214,17 @@ Phaser.RenderTexture.prototype.initCanvas = function()
202214}
203215
204216/**
205- * This function will draw the display object to the texture.
206- *
207- * @method renderWebGL
208- * @param displayObject {DisplayObject} The display object to render this texture on
209- * @param clear {Boolean} If true the texture will be cleared before the displayObject is drawn
210- * @private
211- */
212- Phaser . RenderTexture . prototype . renderWebGL = function ( displayObject , position , clear )
217+ * This function will draw the display object to the texture.
218+ *
219+ * @method Phaser.RenderTexture#renderWebGL
220+ * @memberof Phaser.RenderTexture
221+ * @private
222+ * @param {DisplayObject } displayObject - The display object to render this texture on.
223+ * @param {Phaser.Point } [position] - Where to draw the display object.
224+ * @param {boolean } [clear=false] - If true the texture will be cleared before the displayObject is drawn.
225+ * @param {boolean } [renderHidden=false] - If true displayObjects that have their visible property set to false will still be rendered.
226+ */
227+ Phaser . RenderTexture . prototype . renderWebGL = function ( displayObject , position , clear , renderHidden )
213228{
214229 var gl = PIXI . gl ;
215230
@@ -280,12 +295,15 @@ Phaser.RenderTexture.prototype.renderWebGL = function(displayObject, position, c
280295/**
281296 * This function will draw the display object to the texture.
282297 *
283- * @method renderCanvas
284- * @param displayObject {DisplayObject} The display object to render this texture on
285- * @param clear {Boolean} If true the texture will be cleared before the displayObject is drawn
286- * @private
287- */
288- Phaser . RenderTexture . prototype . renderCanvas = function ( displayObject , position , clear )
298+ * @method Phaser.RenderTexture#renderCanvas
299+ * @memberof Phaser.RenderTexture
300+ * @private
301+ * @param {DisplayObject } displayObject - The display object to render this texture on.
302+ * @param {Phaser.Point } [position] - Where to draw the display object.
303+ * @param {boolean } [clear=false] - If true the texture will be cleared before the displayObject is drawn.
304+ * @param {boolean } [renderHidden=false] - If true displayObjects that have their visible property set to false will still be rendered.
305+ */
306+ Phaser . RenderTexture . prototype . renderCanvas = function ( displayObject , position , clear , renderHidden )
289307{
290308 var children = displayObject . children ;
291309
@@ -307,9 +325,8 @@ Phaser.RenderTexture.prototype.renderCanvas = function(displayObject, position,
307325 this . renderer . context . clearRect ( 0 , 0 , this . width , this . height ) ;
308326 }
309327
310- this . renderer . renderDisplayObject ( displayObject ) ;
328+ this . renderer . renderDisplayObject ( displayObject , renderHidden ) ;
311329
312330 this . renderer . context . setTransform ( 1 , 0 , 0 , 1 , 0 , 0 ) ;
313331
314- // PIXI.texturesToUpdate.push(this.baseTexture);
315332}
0 commit comments