From 0a0aa0281dcbcf3cd96244e182628827af3b2855 Mon Sep 17 00:00:00 2001 From: Ben Richards Date: Thu, 21 Nov 2024 16:35:23 +1300 Subject: [PATCH] Improve `RenderFilters.Replace` static function. --- src/gameobjects/renderFilters/RenderFilters.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gameobjects/renderFilters/RenderFilters.js b/src/gameobjects/renderFilters/RenderFilters.js index 6b84bff46..a36f458ec 100644 --- a/src/gameobjects/renderFilters/RenderFilters.js +++ b/src/gameobjects/renderFilters/RenderFilters.js @@ -860,8 +860,10 @@ var RenderFilters = new Class({ * @since 4.0.0 * @static * @param {Phaser.GameObjects.GameObject} child - The Game Object that is being wrapped by this RenderFilters instance. + * @param {boolean} [autoFocus=false] - Whether the RenderFilters should automatically focus on the child every frame. Sets `autoFocus` property. + * @param {boolean} [autoTransfer=false] - Whether the RenderFilters should automatically transfer properties from the child to itself every frame. Sets `autoTransferProperties` property. If not set, it defaults to the `autoFocus` param. */ -RenderFilters.Replace = function (child) +RenderFilters.Replace = function (child, autoFocus, autoTransfer) { var scene = child.scene; if (!scene) @@ -876,7 +878,7 @@ RenderFilters.Replace = function (child) } var index = child.displayList.getIndex(child); - var renderFilters = new RenderFilters(scene, child); + var renderFilters = new RenderFilters(scene, child, autoFocus, autoTransfer); scene.sys.displayList.addAt(renderFilters, index); return renderFilters;