PixiEffectsManager

PixiEffectsManager

Handle effects (aka PixiJS "filters") on PixiJS objects.

Constructor

new PixiEffectsManager()

Source:

Methods

addEffect(effectData, rendererEffects, rendererObject, target)

Add a new effect on a PixiJS DisplayObject, or replace the one with the same name.

Parameters:
Name Type Description
effectData

The effect data

rendererEffects

The renderer effects

rendererObject

The renderer object

target

The effects target

Source:

applyEffect(rendererObject, effect)

Apply the effect on the PixiJS DisplayObject. Called after the effect is initialized.

Parameters:
Name Type Description
rendererObject

The renderer object

effect

The effect to be applied.

Source:

enableEffect(rendererEffects, name, value)

Enable an effect.

Parameters:
Name Type Description
rendererEffects

The collection of PixiJS filters.

name

The effect name

value

Set to true to enable, false to disable

Source:

hasEffect(rendererEffects, name)

Check if an effect exists.

Parameters:
Name Type Description
rendererEffects

The collection of PixiJS filters.

name

The effect name

Returns:
Type Description

True if the effect exists, false otherwise

Source:

initializeEffect(effectData, rendererEffects, target)

Initialize the renderer effect (PixiJS filter) from the effect data. Call the applyEffect method afterwards, to correctly apply the initialized effects on the object.

Parameters:
Name Type Description
effectData

The effect data

rendererEffects

The collection of PixiJS filters

target

The effects target

Source:

isEffectEnabled(rendererEffects, name)

Check if an effect is enabled.

Parameters:
Name Type Description
rendererEffects

The collection of PixiJS filters.

name

The effect name

Returns:
Type Description

true if the filter is enabled

Source:

removeEffect(rendererEffects, rendererObject, effectName)

Remove the effect with the specified name from a PixiJS DisplayObject.

Parameters:
Name Type Description
rendererEffects

The collection of PixiJS filters.

rendererObject

The renderer object.

effectName

The name of the effect.

Source:

setEffectBooleanParameter(rendererEffects, name, parameterName, value)

Enable or disable the parameter of an effect (boolean).

Parameters:
Name Type Description
rendererEffects

The collection of PixiJS filters.

name

The effect name

parameterName

The parameter name

value

The new value for the parameter

Source:

setEffectDoubleParameter(rendererEffects, name, parameterName, value)

Update the parameter of an effect (with a number).

Parameters:
Name Type Description
rendererEffects

The collection of PixiJS filters.

name

The effect name

parameterName

The parameter name

value

The new value for the parameter

Source:

setEffectStringParameter(rendererEffects, name, parameterName, value)

Update the parameter of an effect (with a string).

Parameters:
Name Type Description
rendererEffects

The collection of PixiJS filters.

name

The effect name

parameterName

The parameter name

value

The new value for the parameter

Source:

updateAllEffectParameters(rendererEffects, effectData)

Updates all the effect parameters.

Parameters:
Name Type Description
rendererEffects
effectData
Source:

updatePreRender()

Update the filters applied on a PixiJS DisplayObject. This must be called after the events and before the rendering.

This allows effects to be sure that they are up to date and ready to render. This is not called on objects that are not rendered on screen ("culling"). This is always called on layers.

Source: