Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Properties

$colliderAdded: Util.Observable<Collider> = ...

Observable that notifies when a collider is added to the body

$colliderRemoved: Util.Observable<Collider> = ...

Observable that notifies when a collider is removed from the body

dependencies?: ComponentCtor<Component<string>>[]

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

events: EventDispatcher<any> = ...
optional?: ComponentCtor<Component<string>>[]
owner?: Entity = null

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

type: "ex.collider" = 'ex.collider'

Type of this component, must be a unique type among component types in you game.

Accessors

Methods

  • clear(): void
  • onRemove(): void
  • set<T>(collider: T): T
  • update(): void
  • Sets up a box geometry based on the current bounds of the associated actor of this physics body.

    If no width/height are specified the body will attempt to use the associated actor's width/height.

    By default, the box is center is at (0, 0) which means it is centered around the actors anchor.

    Parameters

    • width: number
    • height: number
    • anchor: Vector = Vector.Half
    • center: Vector = Vector.Zero

    Returns PolygonCollider