UIButton

UIButton - A UI object that acts as a button

Constructor

new UIButton(posopt, sizeopt, textopt, coloropt)

Create a UIButton object

Parameters:
NameTypeAttributesDefaultDescription
posVector2<optional>
sizeVector2<optional>
textstring<optional>
colorColor<optional>
uiDefaultButtonColor

Extends

Members

children

Properties
TypeDescription
Array.<UIObject>

color

Properties
TypeDescription
Color

font

Properties
TypeDescription
string
Overrides

hoverColor

Properties
TypeDescription
Color

lineColor

Properties
TypeDescription
Color

lineWidth

Properties
TypeDescription
number

localPos

Properties
TypeDescription
Vector2

Local position of the object

parent

Properties
TypeDescription
UIObject

pos

Properties
TypeDescription
Vector2

Screen space position of the object

Overrides

size

Properties
TypeDescription
Vector2

Screen space size of the object

Overrides

text

Properties
TypeDescription
string

textColor

Properties
TypeDescription
Color

visible

Properties
TypeDescription
boolean

Methods

addChild(child)

Add a child UIObject to this object

Parameters:
NameTypeDescription
childUIObject

onChange()

Called when the state of this object changes

onEnter()

Called when the mouse enters the object

onLeave()

Called when the mouse leaves the object

onPress()

Called when the mouse is pressed while over the object

onRelease()

Called when the mouse is released while over the object

removeChild(child)

Remove a child UIObject from this object

Parameters:
NameTypeDescription
childUIObject

render()

Render the object, called automatically by plugin once each frame

update()

Update the object, called automatically by plugin once each frame