new TintEffect()
Applies a persistent or timed color tint to the screen.
- Source:
Extends
- BaseEffect
Methods
apply(mainContext, sceneCanvas, effectPipelineDataopt) → {void}
Applies the screen tint by drawing a colored overlay.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
mainContext |
CanvasRenderingContext2D | The context of the main (visible) canvas. | ||
sceneCanvas |
HTMLCanvasElement | The offscreen canvas. | ||
effectPipelineData |
object |
<optional> |
{} | Data from previous effects. |
- Source:
Returns:
- Type
- void
reset()
Resets the tint effect.
- Source:
setColor(newColor)
Sets the color of the tint.
Parameters:
Name | Type | Description |
---|---|---|
newColor |
string |
- Source:
setOpacity(newOpacity)
Sets the opacity of the tint.
Parameters:
Name | Type | Description |
---|---|---|
newOpacity |
number | Value between 0 and 1. |
- Source:
start()
Starts or restarts the tint effect.
- Source:
stop()
Stops the tint effect. For persistent tints, this effectively removes them.
- Source:
update(deltaTime)
Updates the tint effect. Mainly handles timed tints.
For persistent tints (duration=Infinity), this mostly relies on BaseEffect.
Parameters:
Name | Type | Description |
---|---|---|
deltaTime |
number | The time elapsed since the last frame, in seconds. |
- Source: