Skip to main content

DebugGraphicsComponent

Provide arbitrary drawing for the purposes of debugging your game

Will only show when the Engine is set to debug mode [[Engine.showDebug]] or [[Engine.toggleDebug]]

Hierarchy

Index

Constructors

constructor

Properties

optionalreadonlydependencies

dependencies?: ComponentCtor<Component>[]

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

publicdraw

draw: (ctx: ExcaliburGraphicsContext, debugFlags: DebugConfig) => void

Type declaration

optionalowner

owner?: Entity<any> = undefined

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

publicuseTransform

useTransform: boolean = true

Methods

clone

  • Clones any properties on this component, if that property value has a clone() method it will be called


    Returns Component

optionalonAdd

  • onAdd(owner: Entity<any>): void
  • Optional callback called when a component is added to an entity


    Parameters

    Returns void

optionalonRemove

  • onRemove(previousOwner: Entity<any>): void
  • Optional callback called when a component is removed from an entity


    Parameters

    Returns void