Documentation
    Preparing search index...

    Interface CanvasSandboxApplication<TCanvas, TApplicationOptions>

    Describes an application running inside the CanvasSandbox.

    interface CanvasSandboxApplication<
        TCanvas extends Canvas,
        TApplicationOptions extends CanvasSandboxExpectedOptions,
    > {
        options: TApplicationOptions;
        paused: boolean;
        random: Random;
        onDraw(delta: number, timestamp: number): void;
        pause(paused: boolean): void;
        reconfigure(canvas: TCanvas, options?: Partial<TApplicationOptions>): void;
        start(options?: Partial<TApplicationOptions>): void;
    }

    Type Parameters

    Implemented by

    Index

    Properties

    The options with which the application was constructed.

    paused: boolean

    Is the application currently paused? Should be get/set, but can also be ignored, if the feature isn't used.

    random: Random

    The PRNG used in this application.

    Methods

    • Request the application to draw a new frame.

      Parameters

      • delta: number

        How many milliseconds passed since the last frame draw.

      • timestamp: number

        The current timestamp.

      Returns void

    • Pause rendering.

      Parameters

      • paused: boolean

        Should rendering be paused (true) or unpaused (false)?

      Returns void