Skip to content

TextComp

Defined in: packages/threeplay/src/plugins/hud/types.ts:36

Fields added by text(). Rendered as a DOM element on the render overlay, so any font and character works. With fixed() the object’s pos.x/pos.y are logical screen pixels from the top-left; without it the label floats over the object’s world position.

optional add(this): void

Defined in: packages/threeplay/src/core/types.ts:63

Called when the object enters the scene (or when used on a live object).

GameObj

void

Comp.add


optional destroy(this): void

Defined in: packages/threeplay/src/core/types.ts:69

Called when the object is destroyed or the component removed.

GameObj

void

Comp.destroy


optional fixedUpdate(this): void

Defined in: packages/threeplay/src/core/types.ts:67

Called at the fixed physics rate (50 Hz by default).

GameObj

void

Comp.fixedUpdate


optional inspect(this): string | null | undefined

Defined in: packages/threeplay/src/core/types.ts:71

Short status line shown by the debug inspector.

GameObj

string | null | undefined

Comp.inspect


optional update(this): void

Defined in: packages/threeplay/src/core/types.ts:65

Called once per frame.

GameObj

void

Comp.update

optional conflicts?: string[]

Defined in: packages/threeplay/src/core/types.ts:61

Ids of components that can’t be on the same object (checked both ways).

Comp.conflicts


el: HTMLElement | null

Defined in: packages/threeplay/src/plugins/hud/types.ts:41

The DOM element (escape hatch: style it at will).


id: "text"

Defined in: packages/threeplay/src/plugins/hud/types.ts:37

Unique name. Two components with the same id replace each other.

Comp.id


optional require?: string[]

Defined in: packages/threeplay/src/core/types.ts:59

Ids of components that must be present on the object.

Comp.require


text: string

Defined in: packages/threeplay/src/plugins/hud/types.ts:38


textSize: number

Defined in: packages/threeplay/src/plugins/hud/types.ts:39