Options
All
  • Public
  • Public/Protected
  • All
Menu

Component to manage drawings, using with the position component

Hierarchy

Index

Constructors

Properties

anchor: Vector = Vector.Half

Anchor to apply to graphics by default

copyGraphics: boolean = false

If set to true graphics added to the component will be copied. This can affect performance

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

offset: Vector = Vector.Zero

Offset to apply to graphics by default

onPostDraw: ((ctx: ExcaliburGraphicsContext, elapsedMilliseconds: number) => void)

Type declaration

    • Draws after the entity transform has been applied, and after graphics component graphics has been drawn

      Parameters

      Returns void

onPreDraw: ((ctx: ExcaliburGraphicsContext, elapsedMilliseconds: number) => void)

Type declaration

    • Draws after the entity transform has bene applied, but before graphics component graphics have been drawn

      Parameters

      Returns void

opacity: number = 1

Sets or gets wither all drawings should have an opacity applied

optional?: ComponentCtor<Component<string>>[]
owner?: Entity = null

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

type: "ex.graphics" = 'ex.graphics'

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

visible: boolean = true

Sets or gets wether any drawing should be visible in this component

Accessors

  • get graphics(): {}

Methods

  • getNames(): string[]
  • hide(nameOrGraphic: string | Graphic): void
  • hide(): void
  • onRemove(previousOwner: Entity): void
  • recalculateBounds(): void
  • update(elapsed: number, idempotencyToken?: number): void
  • Update underlying graphics if necesary, called internally

    internal

    Parameters

    • elapsed: number
    • idempotencyToken: number = 0

    Returns void