LabelDirector
Since 0.6
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
| Member | Signature | Description |
|---|---|---|
strings | readonly strings: Strings | |
constructor | constructor(ctx: Ctx, opts: LabelDirectorOptions = {}) | |
set | set(id: string, textKey: string, at: Target): string | Create or move label id, showing textKey at a point or on an entity. |
follow | follow(id: string, textKey: string, target: Target = this.ctx.entity): string | A label pinned to an entity, which the renderer keeps with it as it moves. |
clear | clear(id: string): void | |
clearAll | clearAll(): void | Clear every label this director created. Call from dispose. |
active | get active(): string[] | Ids currently shown by this director. |
fromComponent | fromComponent(id?: string, component?: LabelComponent): string | null | Place the label an entity's label component describes, on that entity. Returns the id, or null. |