| 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 fontSizenumber The new font size -
Set the current displayed text
Name Type Description textstring 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 xnumber this.oX optional The x position to draw graphic ynumber this.oY optional The y position to draw graphic wnumber this.oW optional The width dimention to draw graphic hnumber this.oH optional The height dimention to draw graphic positionResizeboolean true optional If checked, resize postion according to screen resolution -
Drawing the text in box (duplicate of drawChoice)
Name Type Default Description xnumber this.oX optional The x position to draw graphic ynumber this.oY optional The y position to draw graphic wnumber this.oW optional The width dimention to draw graphic hnumber this.oH optional The height dimention to draw graphic positionResizeboolean true optional If checked, resize postion according to screen resolution -
Drawing the text (duplicate of drawChoice)
Name Type Default Description xnumber this.oX optional The x position to draw graphic ynumber this.oY optional The y position to draw graphic wnumber this.oW optional The width dimention to draw graphic hnumber this.oH optional The height dimention to draw graphic positionResizeboolean true optional If checked, resize postion according to screen resolution -
Set the x value
Name Type Default Description xnumber The x value minboolean false optional If checked, transform screen value with min x y -
Set the y value
Name Type Default Description ynumber The y value minboolean false optional If checked, transform screen value with min x y -
Set the w value
Name Type Default Description wnumber The w value minboolean false optional If checked, transform screen value with min x y -
Set the h value
Name Type Default Description hnumber The h value minboolean 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 xnumber The x value ynumber The y value wnumber The w value hnumber The h value