mwg API
    Preparing search index...

    Interface SceneComponent<TScene>

    One self-contained section of a scene - map logic, encounter logic, UI wiring - with its own slice of core.Scene's lifecycle, registered by name into a SceneComponentHost instead of folded into one growing scene class.

    Every hook is optional and receives the owning scene, so a component reads whatever the scene exposes (a two-d.Scene2D's stage, a game's own fields) without the host needing to know what a scene actually is beyond core.Scene's lifecycle shape.

    interface SceneComponent<TScene extends Scene = Scene> {
        name: string;
        create?(scene: TScene): void;
        destroy?(scene: TScene): void;
        onResume?(scene: TScene, result: unknown): void;
        onSuspend?(scene: TScene): void;
        resize?(scene: TScene, width: number, height: number): void;
        update?(scene: TScene, dt: number): void;
    }

    Type Parameters

    Index
    name: string