Allow Filters to force compositing.

This commit is contained in:
Ben Richards 2024-12-12 17:21:56 +13:00
parent 66dd543510
commit 6e3ef2a155

View file

@ -160,6 +160,18 @@ if (typeof WEBGL_RENDERER)
*/
filtersFocusContext: false,
/**
* Whether the Filters component should always draw to a framebuffer,
* even if there are no active filters.
*
* @name Phaser.GameObjects.Components.Filters#filtersForceComposite
* @type {boolean}
* @default false
* @since 4.0.0
* @webglOnly
*/
filtersForceComposite: false,
/**
* The origin of the filters.
* This is derived from the GameObject's origin by default.
@ -205,7 +217,8 @@ if (typeof WEBGL_RENDERER)
this.filters &&
(
this.filters.internal.getActive().length > 0 ||
this.filters.external.getActive().length > 0
this.filters.external.getActive().length > 0 ||
this.filtersForceComposite
);
},