Skip to main content

Class: BlazeText<T>

ui/text.BlazeText

Type parameters

NameType
Textends HTMLParagraphElement | HTMLHeadingElement

Hierarchy

Constructors

constructor

โ€ข new BlazeText<T>(text, level, size, bold?, style?)

Create a BlazeText with a {@link HTMLHeadingElement}.

Type parameters

NameType
Textends HTMLHeadingElement | HTMLParagraphElement

Parameters

NameTypeDescription
textstringThe element's text
levelnumberThe heading level (1 - 6)
sizenumberThe text's size in rem units
bold?booleanWether or not the text is bold
style?TextStyleThe text's style (color)

Overrides

BlazeElement.constructor

Defined in

src/ui/text.ts:32

โ€ข new BlazeText<T>(text, size, bold?, style?)

Create a BlazeText with a {@link HTMLParagraphElement}.

Type parameters

NameType
Textends HTMLHeadingElement | HTMLParagraphElement

Parameters

NameTypeDescription
textstringThe element's text
sizenumberThe text's size in rem units
bold?booleanWether or not the text is bold
style?TextStyleThe text's style (color)

Overrides

BlazeElement< HTMLParagraphElement | HTMLHeadingElement \>.constructor

Defined in

src/ui/text.ts:42

Properties

bold

โ€ข bold: boolean

Defined in

src/ui/text.ts:20


element

โ€ข Readonly element: HTMLHeadingElement | HTMLParagraphElement

Inherited from

BlazeElement.element

Defined in

src/ui/element.ts:9


keys

โ€ข Readonly keys: KeyboardHandler

Inherited from

BlazeElement.keys

Defined in

src/ui/element.ts:11


mouse

โ€ข Readonly mouse: MouseHandler

Inherited from

BlazeElement.mouse

Defined in

src/ui/element.ts:10


size

โ€ข size: number

Defined in

src/ui/text.ts:19


style

โ€ข style: TextStyle

Defined in

src/ui/text.ts:21


text

โ€ข Private text: string

Defined in

src/ui/text.ts:18


touch

โ€ข Readonly touch: TouchHandler

Inherited from

BlazeElement.touch

Defined in

src/ui/element.ts:12

Methods

applyStyles

โ–ธ applyStyles(): void

Applies the size, bold, and style variables to the text's dom element.

Returns

void

Defined in

src/ui/text.ts:73


getText

โ–ธ getText(): string

Gets the element's text.

Returns

string

The element's text

Defined in

src/ui/text.ts:120


setText

โ–ธ setText(text): void

Sets the element's text.

Parameters

NameTypeDescription
textstringThe element's text

Returns

void

Defined in

src/ui/text.ts:110