Class

Text

Text(x, y, text, scale, anchor, vAnchor) → {Text}

A basic component to display text.

Constructor

# new Text(x, y, text, scale, anchor, vAnchor) → {Text}

Initiates a new Text object.

Parameters:
Name Type Default Description
x number

The x position in the parent container or viewport

y number

The y position in the parent container or viewport

text string

The actual text content of the Text element.

scale number

The scale of the text element

anchor HorizontalTextAnchor Text.Anchor.START

Aligns the text horizontally.

vAnchor VerticalTextAnchor Text.VerticalAnchor.BOTTOM

Aligns the text vertically.

See:

View Source index.js, line 2514

The new Text object.

Text

Members

HorizontalTextAnchor

# Anchor

Valid values for horizontal anchoring of the text.

View Source index.js, line 2519

VerticalTextAnchor

# VerticalAnchor

Valid values for vertical anchoring of the text.

View Source index.js, line 2528

Methods

# setText(t) → {void}

Set the text content of this element.

Parameters:
Name Type Description
t string

The new text content

View Source index.js, line 2627

void