Constructors

  • Creates a new Scene.

    Parameters

    • name: string

      The name or identifier for the scene.

    • startTimeinMs: number

      The start time of the scene in milliseconds.

    • durationInMs: number

      The duration of the scene in milliseconds.

    • Optionalwidth: number
    • Optionalheight: number

    Returns Scene

Properties

durationInMs: number

The duration of the scene in milliseconds.

entities: IEntity[] = []
height?: number
name: string

The name or identifier for the scene.

sequence: undefined | Sequence
startTimeinMs: number

The start time of the scene in milliseconds.

width?: number

Methods

  • Adds multiple entities to the scene.

    Parameters

    • Rest...entities: IEntity[]

      An array of entities to add.

    Returns Scene

    The Scene instance for chaining.

  • Adds an entity to the scene.

    Parameters

    Returns Scene

    The Scene instance for chaining.

  • Parameters

    • processor: ((ctx: CanvasRenderingContext2D) => void)
        • (ctx): void
        • Parameters

          • ctx: CanvasRenderingContext2D

          Returns void

    Returns void

  • Adds a WGSL post-processing effect to the scene.

    Type Parameters

    • T extends IWGSLPostProcessorProperties

    Parameters

    • sequence: Sequence

      The Sequence instance.

    • device: GPUDevice

      GPUDevice

    • wgslEntity: WGSLShaderEntity<T>

      The WGSLShaderEntity to use for post-processing.

    Returns void

  • Gets an entity from the scene by its key.

    Type Parameters

    • T

    Parameters

    • key: string

      The key of the entity to retrieve.

    Returns undefined | IEntity

    The entity if found, otherwise undefined.

  • Adds a transition-in effect to the scene.

    Parameters

    • sequence: Sequence

      The Sequence instance associated with the scene.

    • startTime: number

      The time (in milliseconds) within the scene when the transition should start.

    • duration: number

      The duration of the transition in milliseconds.

    • listener: ((ctx: CanvasRenderingContext2D, scene: Scene, progress: number) => void)

      The transition function to apply.

        • (ctx, scene, progress): void
        • Parameters

          • ctx: CanvasRenderingContext2D
          • scene: Scene
          • progress: number

          Returns void

    Returns void

  • Adds a transition-out effect to the scene.

    Parameters

    • sequence: Sequence

      The Sequence instance associated with the scene.

    • startTime: number

      The time (in milliseconds) within the scene when the transition should start.

    • duration: number

      The duration of the transition in milliseconds.

    • listener: ((ctx: CanvasRenderingContext2D, scene: Scene, progress: number) => void)

      The transition function to apply.

        • (ctx, scene, progress): void
        • Parameters

          • ctx: CanvasRenderingContext2D
          • scene: Scene
          • progress: number

          Returns void

    Returns void