@kayelaa/canvas API - v0.2.15
    Preparing search index...

    Interface KaylaScene

    Scene wrapper that manages entity lifecycle and delegates to the underlying LEA scene.

    interface KaylaScene {
        getLayers(): Map<string, KaylaLayerInfo>;
        getFibers(): KaylaFiber<{}, Record<string, KaylaExportables>>[];
        getEntities(): KaylaRectEntity[];
        getScene(): LeaSceneII;
        getGame(): KaylaInternals.KaylaGame;
        getOrCreateLayer(name: string, defaultZ?: number): KaylaLayerInfo;
        getSortedLayers(): KaylaLayerInfo[];
        setLayerVisible(name: string, visible: boolean): void;
        handleDraw(ctx: CanvasRenderingContext2D): void;
        attachTo(game: KaylaInternals.KaylaGame): void;
        spawn(elem: KaylaElement<any>): Promise<void>;
        getRoot(): UnsafeKaylaFiber;
        detach(): void;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Draws all entities in z-order (higher z = drawn later).

      Parameters

      • ctx: CanvasRenderingContext2D

        The 2D rendering context

      Returns void

    • Dangerous: Call this function only ONCE.

      There is no way to unmount a spawned root.

      Mounts a root component tree into the scene.

      Triggers component execution, entity creation, and hook registration.

      Parameters

      Returns Promise<void>