Options
All
  • Public
  • Public/Protected
  • All
Menu

Components are containers for state in Excalibur, the are meant to convey capabilities that an Entity posesses

Implementations of Component must have a zero-arg constructor

Type parameters

  • TypeName: string

Hierarchy

Index

Properties

Methods

Properties

Optional Readonly dependencies

dependencies: ComponentCtor[]

Optionally list any component types this component depends on If the owner entity does not have these components, new components will be added to the entity

Only components with zero-arg constructors are supported as automatic component dependencies

Optional onAdd

onAdd: function

Optional callback called when a component is added to an entity

Type declaration

    • Parameters

      Returns void

Optional onRemove

onRemove: function

Opitonal callback called when acomponent is added to an entity

Type declaration

    • (previousOwner: Entity): void
    • Parameters

      Returns void

Optional owner

owner: Entity

Current owning Entity, if any, of this component. Null if not added to any Entity

Readonly Abstract type

type: TypeName

Type of this component, must be a unique type among component types in you game. See [[BuiltinComponentTypes]] for a list of built in excalibur types

Methods

clone

  • clone(): this