Constructor
new UIButton(posopt, sizeopt, textopt, coloropt)
Create a UIButton object
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pos | Vector2 | <optional> | ||
size | Vector2 | <optional> | ||
text | string | <optional> | ||
color | Color | <optional> | uiDefaultButtonColor |
- Source
Extends
Members
children
PropertiesType | Description |
---|---|
Array.<UIObject> |
- Overrides
- Source
color
PropertiesType | Description |
---|---|
Color |
- Overrides
- Source
font
PropertiesType | Description |
---|---|
string |
- Overrides
- Source
hoverColor
PropertiesType | Description |
---|---|
Color |
- Overrides
- Source
lineColor
PropertiesType | Description |
---|---|
Color |
- Overrides
- Source
lineWidth
PropertiesType | Description |
---|---|
number |
- Overrides
- Source
localPos
PropertiesType | Description |
---|---|
Vector2 | Local position of the object |
- Overrides
- Source
parent
PropertiesType | Description |
---|---|
UIObject |
- Overrides
- Source
pos
PropertiesType | Description |
---|---|
Vector2 | Screen space position of the object |
- Overrides
- Source
size
PropertiesType | Description |
---|---|
Vector2 | Screen space size of the object |
- Overrides
- Source
text
PropertiesType | Description |
---|---|
string |
- Source
textColor
PropertiesType | Description |
---|---|
Color |
- Overrides
- Source
visible
PropertiesType | Description |
---|---|
boolean |
- Overrides
- Source
Methods
addChild(child)
Add a child UIObject to this object
Parameters:
Name | Type | Description |
---|---|---|
child | UIObject |
- Overrides
- Source
onChange()
Called when the state of this object changes
- Overrides
- Source
onEnter()
Called when the mouse enters the object
- Overrides
- Source
onLeave()
Called when the mouse leaves the object
- Overrides
- Source
onPress()
Called when the mouse is pressed while over the object
- Overrides
- Source
onRelease()
Called when the mouse is released while over the object
- Overrides
- Source
removeChild(child)
Remove a child UIObject from this object
Parameters:
Name | Type | Description |
---|---|---|
child | UIObject |
- Overrides
- Source
render()
Render the object, called automatically by plugin once each frame
- Overrides
- Source
update()
Update the object, called automatically by plugin once each frame
- Overrides
- Source