Added getController method

This commit is contained in:
Richard Davey 2023-02-17 01:09:36 +00:00
parent 55cf81e46b
commit 7a1143731e

View file

@ -144,7 +144,7 @@ var PostFXPipeline = new Class({
* reference to it.
*
* @name Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#controller
* @type {Phaser.FX.BaseFX}
* @type {Phaser.FX.Controller}
* @since 3.60.0
*/
this.controller;
@ -251,6 +251,34 @@ var PostFXPipeline = new Class({
this.bindAndDraw(renderTarget);
},
/**
* Returns the FX Controller for this Post FX Pipeline.
*
* This is called internally and not typically required outside.
*
* @method Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#getController
* @since 3.60.0
*
* @param {Phaser.FX.Controller} [controller] - An FX Controller, or undefined.
*
* @return {Phaser.FX.Controller|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} The FX Controller responsible, or this Pipeline.
*/
getController: function (controller)
{
if (controller !== undefined)
{
return controller;
}
else if (this.controller)
{
return this.controller;
}
else
{
return this;
}
},
/**
* Copy the `source` Render Target to the `target` Render Target.
*