Small World Engine API Reference - v0.76.20
    Preparing search index...

    Class AbstractShowcaseAbstract

    Base class for applications built with the SmallWorld engine.

    Hierarchy (View Summary)

    Index
    audio: AudioSystem = ...
    camera: Camera

    The main camera.

    canvas: HTMLCanvasElement

    The canvas element.

    The engine configuration.

    debug: boolean = false

    Whether debug visualization is enabled.

    events: EventDispatcherImpl = ...

    The global event bus for this engine instance.

    forge: Forge
    input: Input = ...
    interactionManager: InteractionManager

    The interaction manager for gamification / picking.

    physics: PhysicsSystem

    The built-in physics system. Stepped automatically each frame when config.enablePhysics is true.

    renderer: Renderer

    The active renderer.

    scene: Scene

    The current scene.

    • A hook method that is called when the canvas element is recreated. By default, it binds the click event to request PointerLock. Inheriting classes can override this if needed.

      Returns void

    • Called once after the GadgetInspector is created. Override in subclasses to register scene-specific inspector controls.

      Parameters

      • _inspector: GadgetInspector

        The newly created inspector instance.

      Returns void

    • Central keyboard control for all showcasess. Inheriting classes can override this method and call super.onKeyDown(event).

      Parameters

      • event: KeyboardEvent

      Returns void

    • Briefly slows down gameplay (app update, physics, scene behaviors) to sell the impact of a hit, while the camera and its effects (e.g. shake) keep running in real time. Rendering and input are unaffected. Global, not per-entity -- see docs/adr/0003-hit-stop-is-global-not-per-entity.md.

      Parameters

      • duration: number

        Real-time seconds the slowdown lasts.

      • timeScale: number = 0.05

        Multiplier applied to deltaTime for gameplay systems while active. Default 0.05 (near-freeze).

      Returns void

    • Default update method for examples. Subclasses can override this to implement custom logic.

      Parameters

      • _deltaTime: number

        Time elapsed since the last frame.

      Returns void

    • Helper to wait for all currently loading assets to finish. Useful to call at the end of setupScene.

      Returns Promise<void>