Skip to main content

Class: BlazeStat<T>

ui/stat.BlazeStat

Type parameters

Name
T

Hierarchy

  • BlazeText<HTMLParagraphElement>

    โ†ณ BlazeStat

Constructors

constructor

โ€ข new BlazeStat<T>(name, value?, size?, bold?, style?)

Create a BlazeStat.

Type parameters

Name
T

Parameters

NameTypeDescription
namestringThe stat's name
value?TThe stat's default value
size?numberThe stat's font size in rem units, if none is given then size will be auto
bold?booleanWether or not the stat's text is bold
style?TextStyleThe style of the element's text

Overrides

BlazeText.constructor

Defined in

src/ui/stat.ts:19

Properties

bold

โ€ข bold: boolean

Inherited from

BlazeText.bold

Defined in

src/ui/text.ts:20


element

โ€ข Readonly element: HTMLHeadingElement | HTMLParagraphElement

Inherited from

BlazeText.element

Defined in

src/ui/element.ts:9


keys

โ€ข Readonly keys: KeyboardHandler

Inherited from

BlazeText.keys

Defined in

src/ui/element.ts:11


mouse

โ€ข Readonly mouse: MouseHandler

Inherited from

BlazeText.mouse

Defined in

src/ui/element.ts:10


name

โ€ข Readonly name: string

Defined in

src/ui/stat.ts:6


size

โ€ข Readonly size: number

Overrides

BlazeText.size

Defined in

src/ui/stat.ts:8


style

โ€ข style: TextStyle

Inherited from

BlazeText.style

Defined in

src/ui/text.ts:21


touch

โ€ข Readonly touch: TouchHandler

Inherited from

BlazeText.touch

Defined in

src/ui/element.ts:12


value

โ€ข Private value: T

Defined in

src/ui/stat.ts:7

Methods

applyStyles

โ–ธ applyStyles(): void

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

Returns

void

Inherited from

BlazeText.applyStyles

Defined in

src/ui/text.ts:73


getText

โ–ธ getText(): string

Gets the element's text.

Returns

string

The element's text

Inherited from

BlazeText.getText

Defined in

src/ui/text.ts:120


getValue

โ–ธ getValue(): T

Gets the stat's value.

Returns

T

The stat's value

Defined in

src/ui/stat.ts:61


refresh

โ–ธ refresh(): void

Update the stat's dom elements.

Returns

void

Defined in

src/ui/stat.ts:32


setText

โ–ธ setText(text): void

Sets the element's text.

Parameters

NameTypeDescription
textstringThe element's text

Returns

void

Inherited from

BlazeText.setText

Defined in

src/ui/text.ts:110


setValue

โ–ธ setValue(value): void

Sets the stat's value.

Parameters

NameTypeDescription
valueTThe stat's value

Returns

void

Defined in

src/ui/stat.ts:51


valueToString

โ–ธ Private valueToString(): string

Returns

string

Defined in

src/ui/stat.ts:37