melonJS
    Preparing search index...

    Class CameraEffect

    Base class for camera effects (shake, fade, flash, transitions, etc.). Subclasses implement update() for per-frame logic and/or draw() for rendering overlays. Effects are automatically removed from the camera when isComplete becomes true.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    camera: Camera2d

    the camera this effect is attached to

    isComplete: boolean

    whether this effect has finished and should be removed

    isPersistent: boolean

    whether this effect should persist across camera/game resets (e.g. transition effects that span state changes)

    false
    

    Methods

    • Called after the scene renders to draw visual overlays (e.g. color fills for fading).

      Parameters

      • _renderer: Renderer

        the renderer to draw with

      • _width: number

        the camera viewport width

      • _height: number

        the camera viewport height

      Returns void