Skip to content

i-text-2d.component overview


Table of contents


utils

IText2dComponent (interface)

A display object that draws a string, created with IDisplayObject2dComponentFactory.createText. Wrap it in an Entity2d to place it in a world, like any other display object.

Signature

export interface IText2dComponent<VTypeDoc extends VisualTypeDocRepo2D = VisualTypeDocRepo2D>
  extends IDisplayObject2dComponent<VTypeDoc> {
  /** The displayed string. `\n` starts a new line. */
  text: string

  /** The current style, with every field the adapter resolved. */
  readonly style: Text2dStyle

  /** Changes the given style fields and keeps the rest. */
  setStyle(style: Text2dStyle): void
}