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
Name | Type | Description |
---|---|---|
name | string | The stat's name |
value? | T | The stat's default value |
size? | number | The stat's font size in rem units, if none is given then size will be auto |
bold? | boolean | Wether or not the stat's text is bold |
style? | TextStyle | The style of the element's text |
Overrides
Defined in
src/ui/stat.ts:19
Properties
bold
โข bold: boolean
Inherited from
Defined in
src/ui/text.ts:20
element
โข Readonly
element: HTMLHeadingElement
| HTMLParagraphElement
Inherited from
Defined in
src/ui/element.ts:9
keys
โข Readonly
keys: KeyboardHandler
Inherited from
Defined in
src/ui/element.ts:11
mouse
โข Readonly
mouse: MouseHandler
Inherited from
Defined in
src/ui/element.ts:10
name
โข Readonly
name: string
Defined in
src/ui/stat.ts:6
size
โข Readonly
size: number
Overrides
Defined in
src/ui/stat.ts:8
style
โข style: TextStyle
Inherited from
Defined in
src/ui/text.ts:21
touch
โข Readonly
touch: TouchHandler
Inherited from
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
Defined in
src/ui/text.ts:73
getText
โธ getText(): string
Gets the element's text.
Returns
string
The element's text
Inherited from
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
Name | Type | Description |
---|---|---|
text | string | The element's text |
Returns
void
Inherited from
Defined in
src/ui/text.ts:110
setValue
โธ setValue(value
): void
Sets the stat's value.
Parameters
Name | Type | Description |
---|---|---|
value | T | The 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