Options
All
  • Public
  • Public/Protected
  • All
Menu

The scene class is the base class for all scenes.

Hierarchy

  • Scene

Index

Constructors

constructor

Properties

entities

entities: Map<string, Entity> = ...

Map of entities in the scene where the key is the entity id and the value is the entity object.

Methods

addEntity

  • addEntity(entity: Entity): void

awake

  • awake(): void

createEntity

  • createEntity(name?: string): Entity
  • Create a new entity and add it to the scene.

    Parameters

    • Optional name: string

      Name of the entity.

    Returns Entity

    The created entity.

destroyEntity

  • destroyEntity(entity: Entity): void

draw

  • draw(step: number): void
  • Called every frame.

    Parameters

    • step: number

      Step between the previous and current frame. Used for interpolation.

    Returns void

getEntities

getEntitiesByName

  • getEntitiesByName(name: string): Entity[]
  • Get all entities with the given name.

    Parameters

    • name: string

      Name of the entities.

    Returns Entity[]

    Array of all entities with the given name.

getEntityById

  • getEntityById(id: string): Entity
  • Get an entity by its id.

    Parameters

    • id: string

      Id of the entity.

    Returns Entity

    The entity with the given id or undefined if no entity with the given id was found.

getEntityByName

  • getEntityByName(name: string): Entity
  • Get an entity by its name.

    Parameters

    • name: string

      Name of the entity.

    Returns Entity

    The entity with the given name or undefined if no entity with the given name was found.

init

  • init(): void

lateUpdate

  • lateUpdate(): void

start

  • start(): void

update

  • update(): void

Generated using TypeDoc