Talos docs

LabelDirector

Since 0.6
Plain text

Signature

export class LabelDirector {
  readonly strings: Strings
  constructor(ctx: Ctx, opts: LabelDirectorOptions = {})
  set(id: string, textKey: string, at: Target): string
  follow(id: string, textKey: string, target: Target = this.ctx.entity): string
  clear(id: string): void
  clearAll(): void
  get active(): string[]
  fromComponent(id?: string, component?: LabelComponent): string | null
}

Import: import { LabelDirector } from "@argus/gameplay"

Members

MemberSignatureDescription
stringsreadonly strings: Strings
constructorconstructor(ctx: Ctx, opts: LabelDirectorOptions = {})
setset(id: string, textKey: string, at: Target): stringCreate or move label id, showing textKey at a point or on an entity.
followfollow(id: string, textKey: string, target: Target = this.ctx.entity): stringA label pinned to an entity, which the renderer keeps with it as it moves.
clearclear(id: string): void
clearAllclearAll(): voidClear every label this director created. Call from dispose.
activeget active(): string[]Ids currently shown by this director.
fromComponentfromComponent(id?: string, component?: LabelComponent): string | nullPlace the label an entity's label component describes, on that entity. Returns the id, or null.