Name | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
text |
string | "" | optional The brut text to display | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
opts |
Object | {} |
optional
Options
|
Properties:
Name | Type | Description |
---|---|---|
text |
string | The brut text to display |
align |
Align | Alignement of the text |
fontSize |
number | The font height used for the text |
fontName |
string | The font name used for the text |
verticalAlign |
AlignVertical | Vertical alignement of the text |
color |
SystemColor | The color used for the text |
bold |
boolean | If checked, make the text bold |
italic |
boolean | If checked, make the text italic |
backColor |
SystemColor | The background color behind the text |
strokeColor |
SystemColor | The stroke color of the text |
font |
string | The font used for the text (combining fontSize + fontName) |
textWidth |
number | The font text width (without resizing) |
Extends
Methods
-
Set the font size and the final font
Name Type Description fontSize
number The new font size -
Set the current displayed text
Name Type Description text
string The new text -
Update the context font (without window resizing), this function is used before a context.measureText
-
Update the context font with resizing
-
Measure text width and stock results in the instance
-
Drawing the text in choice box
Name Type Default Description x
number this.oX optional The x position to draw graphic y
number this.oY optional The y position to draw graphic w
number this.oW optional The width dimention to draw graphic h
number this.oH optional The height dimention to draw graphic positionResize
boolean true optional If checked, resize postion according to screen resolution -
Drawing the text in box (duplicate of drawChoice)
Name Type Default Description x
number this.oX optional The x position to draw graphic y
number this.oY optional The y position to draw graphic w
number this.oW optional The width dimention to draw graphic h
number this.oH optional The height dimention to draw graphic positionResize
boolean true optional If checked, resize postion according to screen resolution -
Drawing the text (duplicate of drawChoice)
Name Type Default Description x
number this.oX optional The x position to draw graphic y
number this.oY optional The y position to draw graphic w
number this.oW optional The width dimention to draw graphic h
number this.oH optional The height dimention to draw graphic positionResize
boolean true optional If checked, resize postion according to screen resolution -
Set the x value
Name Type Default Description x
number The x value min
boolean false optional If checked, transform screen value with min x y -
Set the y value
Name Type Default Description y
number The y value min
boolean false optional If checked, transform screen value with min x y -
Set the w value
Name Type Default Description w
number The w value min
boolean false optional If checked, transform screen value with min x y -
Set the h value
Name Type Default Description h
number The h value min
boolean false optional If checked, transform screen value with min x y -
Set the position to the left
-
Set the position to the top
-
Set the position to the right
-
Set the position to the bot
-
Set all the coords values
Name Type Description x
number The x value y
number The y value w
number The w value h
number The h value