dacha
    Preparing search index...

    Interface World

    The root of the game. The world holds the scenes and exists for the whole game.

    Systems share their APIs through World.systemApi. Game-wide events, such as scene changes and input, are dispatched on the world.

    Hierarchy (View Summary)

    Index
    children: Scene[]

    Children of the entity

    data: Record<string, unknown>

    Custom data storage for world-related information

    id: string

    Id of the entity

    name: string

    Name of the entity

    parent: null

    Parent of the entity

    Registry of system APIs

    • Adds a child to the entity.

      Parameters

      • child: Scene

        Child to add

      Returns void

    • Finds a child entity by a predicate function.

      Parameters

      • predicate: (child: Actor | Scene) => boolean

        A function that runs on each child entity and should return true if the child entity matches the predicate or false otherwise

      • recursive: boolean = true

        Whether to search recursively through the children

      Returns Actor | Scene | undefined

      Child entity or undefined

    • Finds a child entity by its id.

      Parameters

      • id: string

        Id of the child entity

      • recursive: boolean = true

        Whether to search recursively through the children

      Returns Actor | Scene | undefined

      Child entity or undefined

    • Finds a child entity by its name.

      Parameters

      • name: string

        Name of the child entity

      • recursive: boolean = true

        Whether to search recursively through the children

      Returns Actor | Scene | undefined

      Child entity or undefined

    • Removes the entity from its parent.

      Returns void

    • Advanced

      Removes all event listeners from the event target.

      Returns void

    • Removes a child from the entity.

      Parameters

      • child: Scene

        Child to remove

      Returns void