Constructor
new UIObject(posopt, sizeopt)
Create a UIObject
- Source
Members
children
PropertiesType | Description |
---|---|
Array.<UIObject> | A list of this object's children |
- Source
color
PropertiesType | Description |
---|---|
Color | Color of the object |
- Source
cornerRadius
PropertiesType | Description |
---|---|
number | Corner radius for rounded rects |
- Source
disabled
PropertiesType | Description |
---|---|
boolean | Is this object disabled? |
- Source
disabledColor
PropertiesType | Description |
---|---|
Color | Color when disabled |
- Source
extraTouchSize
PropertiesType | Description |
---|---|
number | Extra size added to make small buttons easier to touch on mobile devices |
- Source
font
PropertiesType | Description |
---|---|
string | Font for this objecct |
- Source
hoverColor
PropertiesType | Description |
---|---|
Color | Color used when hovering over the object |
- Source
interactive
PropertiesType | Description |
---|---|
boolean | Is this element interactive |
- Source
lineColor
PropertiesType | Description |
---|---|
Color | Color for line drawing |
- Source
lineWidth
PropertiesType | Description |
---|---|
number | Width for line drawing |
- Source
localPos
PropertiesType | Description |
---|---|
Vector2 | Local position of the object |
- Source
mouseIsHeld
PropertiesType | Description |
---|---|
boolean | Is the mouse held on this element (was pressed while over and hasn't been released) |
- Source
mouseIsOver
PropertiesType | Description |
---|---|
boolean | Is the mouse over this element |
- Source
parent
PropertiesType | Description |
---|---|
UIObject | This object's parent, position is in parent space |
- Source
pos
PropertiesType | Description |
---|---|
Vector2 | Screen space position of the object |
- Source
size
PropertiesType | Description |
---|---|
Vector2 | Screen space size of the object |
- Source
soundClick
PropertiesType | Description |
---|---|
Sound | Sound when interactive element is clicked |
- Source
soundPress
PropertiesType | Description |
---|---|
Sound | Sound when interactive element is pressed |
- Source
soundRelease
PropertiesType | Description |
---|---|
Sound | Sound when interactive element is released |
- Source
text
PropertiesType | Description |
---|---|
string | Text for this ui object |
- Source
textColor
PropertiesType | Description |
---|---|
Color | Color for text |
- Source
textHeight
PropertiesType | Description |
---|---|
number | Override for text height |
- Source
textScale
PropertiesType | Description |
---|---|
number | Scale text to fit in the object |
- Source
textWidth
PropertiesType | Description |
---|---|
number | Override for text width |
- Source
visible
PropertiesType | Description |
---|---|
boolean | Should this object be drawn |
- Source
Methods
addChild(child)
Add a child UIObject to this object
Name | Type | Description |
---|---|---|
child | UIObject |
- Source
getTextSize() → {Vector2}
Get the size for text with overrides and scale
- Source
- Type:
- Vector2
onChange()
Called when the state of this object changes
- Source
onClick()
Called when user clicks on this object
- Source
onEnter()
Called when the mouse enters the object
- Source
onLeave()
Called when the mouse leaves the object
- Source
onPress()
Called when the mouse is pressed while over the object
- Source
onRelease()
Called when the mouse is released while over the object
- Source
removeChild(child)
Remove a child UIObject from this object
Name | Type | Description |
---|---|---|
child | UIObject |
- Source
render()
Render the object, called automatically by plugin once each frame
- Source
update()
Update the object, called automatically by plugin once each frame
- Source
updateInvisible()
Special update when object is not visible
- Source