Renderer

A Renderer is responsible for reading the game state and drawing to the screen.

It is an error to modify Entities or Components from a Renderer.

Functions

get_entity(entity_id)
Arguments:
  • entity_id (number) –
Returns Entity:

An instance of Entity with the given entity_id.

read_components(ComponentType)
Arguments:
  • ComponentType (Type<Component>) – A constructor reference to a subtype of Component.
Returns GCOptimizedList<Readonly<ComponentType>>:
 

A set of readonly instances of the given ComponentType.

read_component(ComponentType)
Arguments:
  • ComponentType (Type<Component>) – A constructor reference to a subtype of Component.
Throws:

SingletonReadError – If more than one Component of the given type exists.

Returns Readonly<TComponent> | null:
 

A readonly reference to a singleton Component of the given type, or null if none exist.