the camera to shake
shake parameters
Optionalaxis?: numberwhich axes (NONE=0, HORIZONTAL=1, VERTICAL=2, BOTH=3)
duration in milliseconds
maximum offset in pixels
OptionalonComplete?: () => voidcallback when the shake finishes
which axes to shake (use camera.AXIS constants)
the camera this effect is attached to
remaining duration in milliseconds
maximum pixel offset during shake
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)
optional callback when shake completes
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).
the renderer to draw with
the camera viewport width
the camera viewport height
Called each frame to update the effect state (e.g. modify camera offset, countdown duration).
A camera effect that shakes the viewport by applying random offsets.
Example