Skip to main content

Class: NameTag

A class that allows you to create a name tag mesh. This name tag mesh also supports colored text using the ColorText syntax. Name tags can be treated like any other mesh.

Name tag

Hierarchy​

Constructors​

constructor​

• new NameTag(text, options?): NameTag

Parameters​

NameType
textstring
optionsPartial<NameTagOptions>

Returns​

NameTag

Overrides​

SpriteText.constructor

Accessors​

backgroundColor​

• get backgroundColor(): string | false

Get the background color of the sprite text.

Returns​

string | false

Inherited from​

SpriteText.backgroundColor

• set backgroundColor(color): void

Set the background color of the sprite text. This will regenerate the sprite.

Parameters​

NameType
colorstring | false

Returns​

void

Inherited from​

SpriteText.backgroundColor


borderColor​

• get borderColor(): string

Get the border color of the sprite text.

Returns​

string

Inherited from​

SpriteText.borderColor

• set borderColor(borderColor): void

Set the border color of the sprite text. This will regenerate the sprite.

Parameters​

NameType
borderColorstring

Returns​

void

Inherited from​

SpriteText.borderColor


borderRadius​

• get borderRadius(): number

Get the border radius of the sprite text.

Returns​

number

Inherited from​

SpriteText.borderRadius

• set borderRadius(borderRadius): void

Set the border radius of the sprite text. This will regenerate the sprite.

Parameters​

NameType
borderRadiusnumber

Returns​

void

Inherited from​

SpriteText.borderRadius


borderWidth​

• get borderWidth(): number

Get the border width of the sprite text.

Returns​

number

Inherited from​

SpriteText.borderWidth

• set borderWidth(borderWidth): void

Set the border width of the sprite text. This will regenerate the sprite.

Parameters​

NameType
borderWidthnumber

Returns​

void

Inherited from​

SpriteText.borderWidth


fontFace​

• get fontFace(): string

Get the font face of the sprite text.

Returns​

string

Inherited from​

SpriteText.fontFace

• set fontFace(fontFace): void

Set the font face of the sprite text. This will regenerate the sprite.

Parameters​

NameType
fontFacestring

Returns​

void

Inherited from​

SpriteText.fontFace


fontSize​

• get fontSize(): number

Get the font size of the sprite text.

Returns​

number

Inherited from​

SpriteText.fontSize

• set fontSize(fontSize): void

Set the font size of the sprite text. This will regenerate the sprite.

Parameters​

NameType
fontSizenumber

Returns​

void

Inherited from​

SpriteText.fontSize


fontWeight​

• get fontWeight(): string

Get the font weight of the sprite text.

Returns​

string

Inherited from​

SpriteText.fontWeight

• set fontWeight(fontWeight): void

Set the font weight of the sprite text. This will regenerate the sprite.

Parameters​

NameType
fontWeightstring

Returns​

void

Inherited from​

SpriteText.fontWeight


padding​

• get padding(): number

Get the padding of the sprite text. This is the space between the text and the border.

Returns​

number

Inherited from​

SpriteText.padding

• set padding(padding): void

Set the padding of the sprite text. This is the space between the text and the border. This will regenerate the sprite.

Parameters​

NameType
paddingnumber

Returns​

void

Inherited from​

SpriteText.padding


strokeColor​

• get strokeColor(): string

Get the stroke color of the sprite text. In other words, the color of the text.

Returns​

string

Inherited from​

SpriteText.strokeColor

• set strokeColor(strokeColor): void

Set the stroke color of the sprite text. In other words, the color of the text. This will regenerate the sprite.

Parameters​

NameType
strokeColorstring

Returns​

void

Inherited from​

SpriteText.strokeColor


strokeWidth​

• get strokeWidth(): number

Get the stroke width of the sprite text.

Returns​

number

Inherited from​

SpriteText.strokeWidth

• set strokeWidth(strokeWidth): void

Set the stroke width of the sprite text. This will regenerate the sprite.

Parameters​

NameType
strokeWidthnumber

Returns​

void

Inherited from​

SpriteText.strokeWidth


text​

• get text(): string

Get the text rendered in the sprite.

Returns​

string

Inherited from​

SpriteText.text

• set text(text): void

Set the text to display. This will regenerate the sprite.

Parameters​

NameType
textstring

Returns​

void

Inherited from​

SpriteText.text


textHeight​

• get textHeight(): number

Get the text height in pixels.

Returns​

number

Inherited from​

SpriteText.textHeight

• set textHeight(textHeight): void

Set the text height to display. This will regenerate the sprite.

Parameters​

NameType
textHeightnumber

Returns​

void

Inherited from​

SpriteText.textHeight