new UIObject(pos, size)uiSystem.js:908Create a UIObject
UI Object - Base level object for all UI elements
Extended by UIButton, UICheckbox, UILayout, UISlider, UIText, UITextInput, UITile, UIVideo
new UIObject(pos, size)uiSystem.js:908Create a UIObject
activeColor : Color|undefineduiSystem.js:935Color of the object when active, uses hoverColor if undefined
align : 'left'|'center'|'right'uiSystem.js:1026Horizontal text alignment: left, center, or right
anchor : Vector2uiSystem.js:1023Where on parent (or canvas if no parent) this object is anchored. Components in [-1, 1]: (0,0)=center, (-1,-1)=top-left, (1,1)=bottom-right. Also acts as self-pivot — e.g. (1,-1) puts your top-right corner at the anchor point.
canBeHover : booleanuiSystem.js:1008True if this can be a hover object
children : Array<UIObject>uiSystem.js:988A list of this object's children
color : ColoruiSystem.js:932Color of the object
cornerRadius : numberuiSystem.js:955Corner radius for rounded rects
destroyed : booleanuiSystem.js:1028Has this object been destroyed?
disabled : booleanuiSystem.js:942Is this object disabled?
disabledColor : ColoruiSystem.js:940Color when disabled
dragActivate : booleanuiSystem.js:1006Activate when dragged over with mouse held down
extraTouchSize : numberuiSystem.js:993Added size to make small buttons easier to touch on mobile devices
font : stringuiSystem.js:961Font for this object
fontStyle : string|undefineduiSystem.js:964Font style for this object or undefined
gradientColor : Color|undefineduiSystem.js:951Uses a gradient fill combined with color
hoverColor : ColoruiSystem.js:946Color used when hovering over the object
interactive : booleanuiSystem.js:1004Is this element interactive
lineColor : ColoruiSystem.js:948Color for line drawing
lineWidth : numberuiSystem.js:953Width for line drawing
localPos : Vector2uiSystem.js:923Position you set: an offset from this object's anchor point (the parent box, or the canvas for roots). This is the input that controls placement — set this, not nativePos.
nativePos : Vector2uiSystem.js:928Resolved position in native UI space, recomputed every frame from localPos + anchor (and nativeHeight, if set). This is a derived output used for drawing and hit-testing; assigning to it has no effect since it is overwritten each frame. Set localPos instead.
parent : UIObject|undefineduiSystem.js:991This object's parent, position is in parent space
shadowBlur : numberuiSystem.js:1012Size of shadow blur
shadowColor : ColoruiSystem.js:1010Color for shadow
shadowOffset : Vector2uiSystem.js:1014Offset of shadow blur
size : Vector2uiSystem.js:930Screen space size of the object
slice : TileSlice|undefineduiSystem.js:959Style to draw with in place of the rectangle, tinted by the color for its state; its art has the frame, so the outline, corner radius and shadow are not drawn
soundClick : Sound|undefineduiSystem.js:1002Sound when interactive element is clicked
soundPress : Sound|undefineduiSystem.js:996Sound when interactive element is pressed
soundRelease : Sound|undefineduiSystem.js:999Sound when interactive element is released
text : string|undefineduiSystem.js:938Text for this ui object
textColor : ColoruiSystem.js:944Color for text
textFitScale : numberuiSystem.js:972Scale text to fit in the object
textHeight : number|undefineduiSystem.js:970Override for text height
textLineColor : ColoruiSystem.js:980Color for text line drawing
textLineWidth : numberuiSystem.js:982Width for text line drawing
textShadow : Vector2|undefineduiSystem.js:978How much to offset the text shadow or undefined. UIText draws it in its shadowColor, which is clear by default, so set that too; the blurred shadow then shows as well unless shadowBlur and shadowOffset are zero. The other widgets draw it in black
textWidth : number|undefineduiSystem.js:967Override for text width
visible : booleanuiSystem.js:984Should this object be drawn
addChild(child) → UIObjectuiSystem.js:1036Add a child UIObject to this object, returns child for chaining
child UIObjectThe child object added
click(playSound)uiSystem.js:1309Internal function called when object is clicked
playSound boolean optional, default truedestroy()uiSystem.js:1055Destroy this object, destroy its children, detach its parent, and mark it for removal
getTextPos(textSize) → Vector2uiSystem.js:1247Get where the text is drawn, the center, or the edge of the text area its align puts it against
textSize Vector2From getTextSize
getTextSize() → Vector2uiSystem.js:1235Get the size for text with overrides and scale
isActiveObject() → booleanuiSystem.js:1262Is the mouse held onto this element
isHoverObject() → booleanuiSystem.js:1258Is the mouse hovering over this element
isInteractive() → booleanuiSystem.js:1274Can it be interacted with, it and every parent visible and enabled
isKeyInputObject() → booleanuiSystem.js:1270Is this object in keyboard input mode
isMouseOverlapping() → booleanuiSystem.js:1083Check if the mouse is overlapping this ui object
onChange()uiSystem.js:1339Called when the state of this object changes
onClick()uiSystem.js:1336Called when user clicks on this object
onEnter()uiSystem.js:1323Called when the mouse enters the object
onLeave()uiSystem.js:1326Called when the mouse leaves the object
onPress()uiSystem.js:1329Called when the mouse is pressed while over the object
onRelease()uiSystem.js:1333Called when a press on it ends, wherever the mouse is let go, or when it is disabled or hidden while held, or an edit takes the press; onClick is the one for a press let go over it
onRender()uiSystem.js:1320Called each frame before object renders
onUpdate()uiSystem.js:1317Called each frame before object updates
render()uiSystem.js:1207Render the object, called automatically by plugin once each frame
renderDebug(visible)uiSystem.js:1296Called if uiDebug is enabled
visible boolean optional, default truetoString() → stringuiSystem.js:1278Returns string containing info about this object for debugging
update() → voiduiSystem.js:1095Update the object, called automatically by plugin once each frame