new FlashEffect()
Creates a screen flash visual effect with a specified color and opacity.
- Source:
Extends
- BaseEffect
Methods
apply(mainContext, sceneCanvas, effectPipelineDataopt) → {void}
Applies the screen flash by drawing a colored overlay.
This method is called by the EffectsManager during its postRender phase,
typically after the scene and any positional effects have been drawn.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
mainContext |
CanvasRenderingContext2D | The context of the main (visible) canvas. | ||
sceneCanvas |
HTMLCanvasElement | The offscreen canvas (not directly used by flash, but passed by manager). | ||
effectPipelineData |
object |
<optional> |
{} | Data from previous effects (not typically used by flash). |
- Source:
Returns:
- Type
- void
reset()
Resets the flash effect to its initial state.
- Source:
start()
Starts or restarts the flash effect.
- Source:
update(deltaTime)
Updates the flash effect's opacity over time if fadeOut is enabled.
Parameters:
Name | Type | Description |
---|---|---|
deltaTime |
number | The time elapsed since the last frame, in seconds. |
- Source: