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

    Class SmallWorldAbstract

    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.

    • Destroys the engine instance, freeing memory and removing all global event listeners.

      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

    • Called to setup the scene after the engine is initialized.

      Returns Promise<void>

    • Initializes and starts the application loop.

      Returns Promise<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

    • Called every frame to update application logic.

      Parameters

      • deltaTime: number

        Time elapsed since the last frame in seconds.

      Returns void