-
Notifications
You must be signed in to change notification settings - Fork 16
Label Objects
#Overview Label objects can only be created after you have a gui object, by calling the gui's addLabel method. They are the most boring of all elements, capable of doing nothing but sitting there, saying stuff.
- posX, posY, width, height
- The position and dimensions of the gui, in screen coordinates.
- text
- The text of the label. What it says, basically.
- style
- The style table to use on this gui. Style table can be loaded with gml.loadStyle(), by default an included default style will be used.
- gui
- the gui object this label is contained by.
- label:hide()
- Hides the label, preventing it from saying it's thing and and making it sad.
- label:show()
- Unhides, or shows, the label, allowing it to say it's thing and making it happy again.
- label:draw()
- Forces the label to be redrawn immediately. Useful if you've been directly manipulating it's style or properties from code and need those changes to update.
Styles specific to labels are applied in gui style sheets using the element "label". At present, Labels have no states, so there are no valid gss :state modifiers that will affect gui styling.
The labels' will inherit the style table used by their containing gui, unless they are explicitly given their own style table. Individual style properties can also be set as values directly on the label object, ex, "label.text-color=0x00ffff" would make the label text bright cyan.
For more general information on styles, see the styles page
###Style Properties
| Propery | Value Type | Description |
|---|---|---|
| text-color | int1 | the color of the label's text |
| text-background | int1 | the background color used for the label |
1colors are 24-bit, with 8 bits each R, G, and B, and can be given as normal integers, like 0 (which would be black), or hex values, like 0xff0000 (red).