the camera to apply the fade to
fade parameters
CSS color value or Color instance
Optionaldirection?: "in" | "out""in" fades to color, "out" fades from color to transparent
Optionalduration?: numberfade duration in milliseconds
OptionalonComplete?: () => voidcallback when the fade finishes
the camera this effect is attached to
the overlay color
fade direction: "in" fades to the color, "out" fades from the color back to transparent
whether this effect has finished and should be removed
whether this effect should persist across camera/game resets (e.g. transition effects that span state changes)
the tween controlling alpha transition
Called when the effect is removed from the camera. Override to clean up resources.
Called after the scene renders to draw visual overlays (e.g. color fills for fading).
Called each frame to update the effect state (e.g. modify camera offset, countdown duration).
A camera effect that fades the screen to or from a color overlay.
Example
Example