Skip to main content

Function: addTextComponent()

addTextComponent(world, entity, options): TextEcsComponent

Defined in: text/components/text-component.ts:197

Attaches a TextEcsComponent to entity.

Parameters​

world​

EcsWorld

The ECS world entity belongs to.

entity​

number

The entity to attach the component to.

options​

TextRequiredOptions & Partial<TextEcsComponent>

Options for configuring the text. text, fontAtlas, and size have no sensible default and must always be provided.

Returns​

TextEcsComponent

The attached component, for further tuning or runtime changes.