This commit is contained in:
NoryiE
2025-10-27 07:26:29 +00:00
parent d0a444a772
commit 44c80f074f
10 changed files with 704 additions and 126 deletions

View File

@@ -12,6 +12,7 @@ Extends: `PropertySystem`
|name|string|BaseElement|User-defined name for the element|
|eventCallbacks|table|BaseElement|Collection of registered event handler functions|
|enabled|boolean|BaseElement|Controls event processing for this element|
|states|table|{}|Table of currently active states with their priorities|
## Functions
@@ -22,6 +23,14 @@ Extends: `PropertySystem`
|[BaseElement:isType](#baseelement-istype-type)|boolean|Tests if element is of or inherits given type|
|[BaseElement:listenEvent](#baseelement-listenevent-eventname-enable)|table|Enables/disables event handling for this element|
|[BaseElement:registerCallback](#baseelement-registercallback-event-callback)|table|Registers a function to handle specific events|
|[BaseElement:registerState](#baseelement-registerstate-statename-condition-priority)|BaseElement|Registers a state|
|[BaseElement:setState](#baseelement-setstate-statename-priority)|BaseElement|Activates a state|
|[BaseElement:unsetState](#baseelement-unsetstate-statename)|BaseElement|Deactivates a state|
|[BaseElement:hasState](#baseelement-hasstate-statename)|boolean|Checks if state is active|
|[BaseElement:getCurrentState](#baseelement-getcurrentstate)|string|nil|Gets current primary state|
|[BaseElement:getActiveStates](#baseelement-getactivestates)|table|Gets all active states|
|[BaseElement:updateConditionalStates](#baseelement-updateconditionalstates)|BaseElement|Updates conditional states|
|[BaseElement:unregisterState](#baseelement-unregisterstate-statename)|BaseElement|Removes state definition|
|[BaseElement:fireEvent](#baseelement-fireevent-event-any)|table|Triggers event callbacks with provided arguments|
|[BaseElement:onChange](#baseelement-onchange-property-callback)|table|Watches property changes with callback notification|
|[BaseElement:getBaseFrame](#baseelement-getbaseframe)|BaseFrame|Retrieves the root frame of this element's tree|
@@ -78,6 +87,80 @@ Adds an event handler function with automatic event registration
### Returns
* `table` `self` The BaseElement instance
## BaseElement:registerState(stateName, condition?, priority?)
Registers a new state with optional auto-condition
### Parameters
* `stateName` `string` The name of the state
* `condition` *(optional)* `function` Optional: Function that returns true if state is active: function(element) return boolean end
* `priority` *(optional)* `number` Priority (higher = more important, default: 0)
### Returns
* `BaseElement` `self` The BaseElement instance
## BaseElement:setState(stateName, priority?)
Manually activates a state
### Parameters
* `stateName` `string` The state to activate
* `priority` *(optional)* `number` Optional priority override
### Returns
* `BaseElement` self
## BaseElement:unsetState(stateName)
Manually deactivates a state
### Parameters
* `stateName` `string` The state to deactivate
### Returns
* `BaseElement` self
## BaseElement:hasState(stateName)
Checks if a state is currently active
### Parameters
* `stateName` `string` The state to check
### Returns
* `boolean` isActive
## BaseElement:getCurrentState()
Gets the highest priority active state
### Returns
* `string|nil` `currentState` The state with highest priority
## BaseElement:getActiveStates()
Gets all currently active states sorted by priority
### Returns
* `table` `states` Array of {name, priority} sorted by priority
## BaseElement:updateConditionalStates()
Updates all states that have auto-conditions
### Returns
* `BaseElement` self
## BaseElement:unregisterState(stateName)
Removes a state from the registry
### Parameters
* `stateName` `string` The state to remove
### Returns
* `BaseElement` self
## BaseElement:fireEvent(event, any)
Executes all registered callbacks for the specified event

View File

@@ -0,0 +1,107 @@
# Collection
_This is the Collection class. It provides a collection of items_
Extends: `VisualElement`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
|selectable|boolean|true|Whether items can be selected|
|multiSelection|boolean|false|Whether multiple items can be selected at once|
|selectedBackground|color|blue|Background color for selected items|
|selectedForeground|color|white|Text color for selected items|
## Events
|Event|Parameters|Description|
|---|---|---|
|onSelect|`index number, item table`|Fired when an item is selected|
## Functions
|Method|Returns|Description|
|---|---|---|
|[Collection:addItem](#collection-additem-text)|Collection|Adds an item to the Collection|
|[Collection:removeItem](#collection-removeitem-index)|Collection|Removes an item from the Collection|
|[Collection:clear](#collection-clear)|Collection|Clears all items from the Collection|
|[Collection:getSelectedItems](#collection-getselecteditems)|table|Gets the currently selected items|
|[Collection:getSelectedItem](#collection-getselecteditem)|selected|Gets first selected item|
|[Collection:onSelect](#collection-onselect-callback)|Collection|Registers a callback for the select event|
## Collection:addItem(text)
Adds an item to the Collection
### Parameters
* `text` `string|table` The item to add (string or item table)
### Returns
* `Collection` `self` The Collection instance
### Usage
```lua
Collection:addItem("New Item")
Collection:addItem({text="Item", callback=function() end})
```
## Collection:removeItem(index)
Removes an item from the Collection
### Parameters
* `index` `number` The index of the item to remove
### Returns
* `Collection` `self` The Collection instance
### Usage
```lua
Collection:removeItem(1)
```
## Collection:clear()
Clears all items from the Collection
### Returns
* `Collection` `self` The Collection instance
### Usage
```lua
Collection:clear()
```
## Collection:getSelectedItems()
Gets the currently selected items
### Returns
* `table` `selected` Collection of selected items
### Usage
```lua
local selected = Collection:getSelectedItems()
```
## Collection:getSelectedItem()
Gets first selected item
### Returns
* `selected` `The` first item
## Collection:onSelect(callback)
Registers a callback for the select event
### Parameters
* `callback` `function` The callback function to register
### Returns
* `Collection` `self` The Collection instance
### Usage
```lua
Collection:onSelect(function(index, item) print("Selected item:", index, item) end)
```

View File

@@ -14,8 +14,6 @@ Extends: `DropDown`
|viewOffset|number|0|Horizontal scroll position for viewing long text|
|placeholder|string|"..."|Text shown when the input is empty|
|placeholderColor|color|gray|Color used for placeholder text|
|focusedBackground|color|blue|Background color when input is focused|
|focusedForeground|color|white|Text color when input is focused|
|autoComplete|boolean|false|Enables filtering dropdown items while typing|
|manuallyOpened|boolean|false|Indicates if dropdown was opened by user action|
@@ -24,14 +22,8 @@ Extends: `DropDown`
|Method|Returns|Description|
|---|---|---|
|[ComboBox.new](#combobox-new)|ComboBox|Creates a new ComboBox instance|
|[ComboBox:setText](#combobox-settext-text)|ComboBox|Sets the text content|
|[ComboBox:getText](#combobox-gettext)|string|Gets the text content|
|[ComboBox:setEditable](#combobox-seteditable-editable)|ComboBox|Sets editable state|
|[ComboBox:char](#combobox-char-char)|-|Handles character input|
|[ComboBox:key](#combobox-key-key-held)|-|Handles key input|
|[ComboBox:render](#combobox-render)|-|Renders the ComboBox|
|[ComboBox:focus](#combobox-focus)|-|Called when gaining focus|
|[ComboBox:blur](#combobox-blur)|-|Called when losing focus|
## ComboBox.new()
@@ -40,33 +32,6 @@ Creates a new ComboBox instance
### Returns
* `ComboBox` `self` The newly created ComboBox instance
## ComboBox:setText(text)
Sets the text content of the ComboBox
### Parameters
* `text` `string` The text to set
### Returns
* `ComboBox` self
## ComboBox:getText()
Gets the current text content
### Returns
* `string` `text` The current text
## ComboBox:setEditable(editable)
Sets whether the ComboBox is editable
### Parameters
* `editable` `boolean` Whether the ComboBox should be editable
### Returns
* `ComboBox` self
## ComboBox:char(char)
Handles character input when editable
@@ -81,15 +46,3 @@ Handles key input when editable
### Parameters
* `key` `number` The key code that was pressed
* `held` `boolean` Whether the key is being held
## ComboBox:render()
Renders the ComboBox
## ComboBox:focus()
Called when the ComboBox gains focus
## ComboBox:blur()
Called when the ComboBox loses focus

View File

@@ -7,7 +7,6 @@ Extends: `List`
|Property|Type|Default|Description|
|---|---|---|---|
|isOpen|boolean|false|Controls the expanded/collapsed state|
|dropdownHeight|number|5|Maximum visible items when expanded|
|selectedText|string|""|Text shown when no selection made|
|dropSymbol|string|"\31"|Indicator for dropdown state|

View File

@@ -13,8 +13,6 @@ Extends: `VisualElement`
|viewOffset|number|0|The horizontal scroll offset for viewing long text|
|placeholder|string|...|Text to display when input is empty|
|placeholderColor|color|gray|Color of the placeholder text|
|focusedBackground|color|blue|Background color when input is focused|
|focusedForeground|color|white|Foreground color when input is focused|
|cursorColor|number|nil|Color of the cursor|
|replaceChar|string|nil|Character to replace the input with (for password fields)|

View File

@@ -2,18 +2,13 @@
_This is the list class. It provides a scrollable list of selectable items with support for _
_custom item rendering, separators, and selection handling._
Extends: `VisualElement`
Extends: `Collection`
## Properties
|Property|Type|Default|Description|
|---|---|---|---|
|items|table|{}|List of items to display. Items can be tables with properties including selected state|
|selectable|boolean|true|Whether items in the list can be selected|
|multiSelection|boolean|false|Whether multiple items can be selected at once|
|offset|number|0|Current scroll offset for viewing long lists|
|selectedBackground|color|blue|Background color for selected items|
|selectedForeground|color|white|Text color for selected items|
## Events
@@ -25,77 +20,10 @@ Extends: `VisualElement`
|Method|Returns|Description|
|---|---|---|
|[List:addItem](#list-additem-text)|List|Adds an item to the list|
|[List:removeItem](#list-removeitem-index)|List|Removes an item from the list|
|[List:clear](#list-clear)|List|Clears all items from the list|
|[List:getSelectedItems](#list-getselecteditems)|table|Gets the currently selected items|
|[List:getSelectedItem](#list-getselecteditem)|selected|Gets first selected item|
|[List:onSelect](#list-onselect-callback)|List|Registers a callback for the select event|
|[List:scrollToBottom](#list-scrolltobottom)|List|Scrolls the list to the bottom|
|[List:scrollToTop](#list-scrolltotop)|List|Scrolls the list to the top|
## List:addItem(text)
Adds an item to the list
### Parameters
* `text` `string|table` The item to add (string or item table)
### Returns
* `List` `self` The List instance
### Usage
```lua
list:addItem("New Item")
list:addItem({text="Item", callback=function() end})
```
## List:removeItem(index)
Removes an item from the list
### Parameters
* `index` `number` The index of the item to remove
### Returns
* `List` `self` The List instance
### Usage
```lua
list:removeItem(1)
```
## List:clear()
Clears all items from the list
### Returns
* `List` `self` The List instance
### Usage
```lua
list:clear()
```
## List:getSelectedItems()
Gets the currently selected items
### Returns
* `table` `selected` List of selected items
### Usage
```lua
local selected = list:getSelectedItems()
```
## List:getSelectedItem()
Gets first selected item
### Returns
* `selected` `The` first item
## List:onSelect(callback)
Registers a callback for the select event

View File

@@ -15,15 +15,12 @@ Extends: `BaseElement`
|height|number|1|The height of the element|
|background|color|black|The background color|
|foreground|color|white|The text/foreground color|
|clicked|boolean|false|Whether the element is currently clicked|
|hover|boolean|false|Whether the mouse is currently hover over the element (Craftos-PC only)|
|backgroundEnabled|boolean|true|Whether to render the background|
|borderTop|boolean|false|Draw top border|
|borderBottom|boolean|false|Draw bottom border|
|borderLeft|boolean|false|Draw left border|
|borderRight|boolean|false|Draw right border|
|borderColor|color|white|Border color|
|focused|boolean|false|Whether the element has input focus|
|visible|boolean|true|Whether the element is visible|
|ignoreOffset|boolean|false|Whether to ignore the parent's offset|
@@ -37,7 +34,40 @@ Extends: `BaseElement`
|Method|Returns|Description|
|---|---|---|
|[VisualElement:setConstraint](#visualelement-setconstraint-property-targetelement-targetproperty-offset)|VisualElement|Sets a constraint on a property relative to another element's property|
|[VisualElement:resolveAllConstraints](#visualelement-resolveallconstraints)|VisualElement|Resolves all constraints for the element|
|[VisualElement:removeConstraint](#visualelement-removeconstraint-property)|VisualElement|Removes a constraint from the element|
|[VisualElement:updateConstraints](#visualelement-updateconstraints)|VisualElement|Updates all constraints, recalculating positions and sizes|
|[VisualElement:alignRight](#visualelement-alignright-target-offset)|VisualElement|Aligns the element's right edge to the target's right edge with optional offset|
|[VisualElement:alignLeft](#visualelement-alignleft-target-offset)|VisualElement|Aligns the element's left edge to the target's left edge with optional offset|
|[VisualElement:alignTop](#visualelement-aligntop-target-offset)|VisualElement|Aligns the element's top edge to the target's top edge with optional offset|
|[VisualElement:alignBottom](#visualelement-alignbottom-target-offset)|VisualElement|Aligns the element's bottom edge to the target's bottom edge with optional offset|
|[VisualElement:centerHorizontal](#visualelement-centerhorizontal-target-offset)|VisualElement|Centers the element horizontally relative to the target with optional offset|
|[VisualElement:centerVertical](#visualelement-centervertical-target-offset)|VisualElement|Centers the element vertically relative to the target with optional offset|
|[VisualElement:centerIn](#visualelement-centerin-target)|VisualElement|Centers the element both horizontally and vertically relative to the target|
|[VisualElement:rightOf](#visualelement-rightof-target-gap)|VisualElement|Positions the element to the right of the target with optional gap|
|[VisualElement:leftOf](#visualelement-leftof-target-gap)|VisualElement|Positions the element to the left of the target with optional gap|
|[VisualElement:below](#visualelement-below-target-gap)|VisualElement|Positions the element below the target with optional gap|
|[VisualElement:above](#visualelement-above-target-gap)|VisualElement|Positions the element above the target with optional gap|
|[VisualElement:stretchWidth](#visualelement-stretchwidth-target-margin)|VisualElement|Stretches the element to match the target's width with optional margin|
|[VisualElement:stretchHeight](#visualelement-stretchheight-target-margin)|VisualElement|Stretches the element to match the target's height with optional margin|
|[VisualElement:stretch](#visualelement-stretch-target-margin)|VisualElement|Stretches the element to match the target's width and height with optional margin|
|[VisualElement:widthPercent](#visualelement-widthpercent-target-percent)|VisualElement|Sets the element's width as a percentage of the target's width|
|[VisualElement:heightPercent](#visualelement-heightpercent-target-percent)|VisualElement|Sets the element's height as a percentage of the target's height|
|[VisualElement:matchWidth](#visualelement-matchwidth-target-offset)|VisualElement|Matches the element's width to the target's width with optional offset|
|[VisualElement:matchHeight](#visualelement-matchheight-target-offset)|VisualElement|Matches the element's height to the target's height with optional offset|
|[VisualElement:fillParent](#visualelement-fillparent-margin)|VisualElement|Stretches the element to fill its parent's width and height with optional margin|
|[VisualElement:fillWidth](#visualelement-fillwidth-margin)|VisualElement|Stretches the element to fill its parent's width with optional margin|
|[VisualElement:fillHeight](#visualelement-fillheight-margin)|VisualElement|Stretches the element to fill its parent's height with optional margin|
|[VisualElement:center](#visualelement-center)|VisualElement|Centers the element within its parent both horizontally and vertically|
|[VisualElement:toRight](#visualelement-toright-gap)|VisualElement|Aligns the element's right edge to its parent's right edge with optional gap|
|[VisualElement:toLeft](#visualelement-toleft-gap)|VisualElement|Aligns the element's left edge to its parent's left edge with optional gap|
|[VisualElement:toTop](#visualelement-totop-gap)|VisualElement|Aligns the element's top edge to its parent's top edge with optional gap|
|[VisualElement:toBottom](#visualelement-tobottom-gap)|VisualElement|Aligns the element's bottom edge to its parent's bottom edge with optional gap|
|[VisualElement:isInBounds](#visualelement-isinbounds-x-y)|boolean|Checks if point is within bounds|
|[VisualElement:setFocused](#visualelement-setfocused-focused-internal)|VisualElement|Sets focus state|
|[VisualElement:isFocused](#visualelement-isfocused)|boolean|Checks if element is focused|
|[VisualElement:isFocused](#visualelement-isfocused)|boolean|Checks if element is focused|
|[VisualElement:addBorder](#visualelement-addborder-colororoptions)|VisualElement|Adds or updates a drawable character border around the element using the canvas plugin.
The border will automatically adapt to size/background changes because the command
reads current properties each render.|
@@ -47,6 +77,317 @@ reads current properties each render.|
|[VisualElement:getRelativePosition](#visualelement-getrelativeposition-x-y)|number, number|Returns the relative position of the element|
|[VisualElement:prioritize](#visualelement-prioritize)|VisualElement|Prioritizes the element by moving it to the top of its parent's children|
## VisualElement:setConstraint(property, targetElement, targetProperty, offset)
Sets a constraint on a property relative to another element's property
### Parameters
* `property` `string` The property to constrain (x, y, width, height, left, right, top, bottom, centerX, centerY)
* `targetElement` `BaseElement|string` The target element or "parent"
* `targetProperty` `string` The target property to constrain to (left, right, top, bottom, centerX, centerY, width, height)
* `offset` `number` The offset to apply (negative = inside, positive = outside, fractional = percentage)
### Returns
* `VisualElement` `self` The element instance
## VisualElement:resolveAllConstraints()
Resolves all constraints for the element
### Returns
* `VisualElement` `self` The element instance
## VisualElement:removeConstraint(property)
Removes a constraint from the element
### Parameters
* `property` `string` The property of the constraint to remove
### Returns
* `VisualElement` `self` The element instance
## VisualElement:updateConstraints()
Updates all constraints, recalculating positions and sizes
### Returns
* `VisualElement` `self` The element instance
## VisualElement:alignRight(target, offset?)
Aligns the element's right edge to the target's right edge with optional offset
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `offset` *(optional)* `number` Offset from the edge (negative = inside, positive = outside, default: 0)
### Returns
* `VisualElement` self
## VisualElement:alignLeft(target, offset?)
Aligns the element's left edge to the target's left edge with optional offset
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `offset` *(optional)* `number` Offset from the edge (negative = inside, positive = outside, default: 0)
### Returns
* `VisualElement` self
## VisualElement:alignTop(target, offset?)
Aligns the element's top edge to the target's top edge with optional offset
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `offset` *(optional)* `number` Offset from the edge (negative = inside, positive = outside, default: 0)
### Returns
* `VisualElement` self
## VisualElement:alignBottom(target, offset?)
Aligns the element's bottom edge to the target's bottom edge with optional offset
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `offset` *(optional)* `number` Offset from the edge (negative = inside, positive = outside, default: 0)
### Returns
* `VisualElement` self
## VisualElement:centerHorizontal(target, offset?)
Centers the element horizontally relative to the target with optional offset
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `offset` *(optional)* `number` Horizontal offset from center (default: 0)
### Returns
* `VisualElement` self
## VisualElement:centerVertical(target, offset?)
Centers the element vertically relative to the target with optional offset
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `offset` *(optional)* `number` Vertical offset from center (default: 0)
### Returns
* `VisualElement` self
## VisualElement:centerIn(target)
Centers the element both horizontally and vertically relative to the target
### Parameters
* `target` `BaseElement|string` The target element or "parent"
### Returns
* `VisualElement` self
## VisualElement:rightOf(target, gap?)
Positions the element to the right of the target with optional gap
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `gap` *(optional)* `number` Gap between elements (default: 0)
### Returns
* `VisualElement` self
## VisualElement:leftOf(target, gap?)
Positions the element to the left of the target with optional gap
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `gap` *(optional)* `number` Gap between elements (default: 0)
### Returns
* `VisualElement` self
## VisualElement:below(target, gap?)
Positions the element below the target with optional gap
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `gap` *(optional)* `number` Gap between elements (default: 0)
### Returns
* `VisualElement` self
## VisualElement:above(target, gap?)
Positions the element above the target with optional gap
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `gap` *(optional)* `number` Gap between elements (default: 0)
### Returns
* `VisualElement` self
## VisualElement:stretchWidth(target, margin?)
Stretches the element to match the target's width with optional margin
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `margin` *(optional)* `number` Margin on each side (default: 0)
### Returns
* `VisualElement` self
## VisualElement:stretchHeight(target, margin?)
Stretches the element to match the target's height with optional margin
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `margin` *(optional)* `number` Margin on top and bottom (default: 0)
### Returns
* `VisualElement` self
## VisualElement:stretch(target, margin?)
Stretches the element to match the target's width and height with optional margin
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `margin` *(optional)* `number` Margin on all sides (default: 0)
### Returns
* `VisualElement` self
## VisualElement:widthPercent(target, percent)
Sets the element's width as a percentage of the target's width
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `percent` `number` Percentage of target's width (0-100)
### Returns
* `VisualElement` self
## VisualElement:heightPercent(target, percent)
Sets the element's height as a percentage of the target's height
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `percent` `number` Percentage of target's height (0-100)
### Returns
* `VisualElement` self
## VisualElement:matchWidth(target, offset?)
Matches the element's width to the target's width with optional offset
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `offset` *(optional)* `number` Offset to add to target's width (default: 0)
### Returns
* `VisualElement` self
## VisualElement:matchHeight(target, offset?)
Matches the element's height to the target's height with optional offset
### Parameters
* `target` `BaseElement|string` The target element or "parent"
* `offset` *(optional)* `number` Offset to add to target's height (default: 0)
### Returns
* `VisualElement` self
## VisualElement:fillParent(margin?)
Stretches the element to fill its parent's width and height with optional margin
### Parameters
* `margin` *(optional)* `number` Margin on all sides (default: 0)
### Returns
* `VisualElement` self
## VisualElement:fillWidth(margin?)
Stretches the element to fill its parent's width with optional margin
### Parameters
* `margin` *(optional)* `number` Margin on left and right (default: 0)
### Returns
* `VisualElement` self
## VisualElement:fillHeight(margin?)
Stretches the element to fill its parent's height with optional margin
### Parameters
* `margin` *(optional)* `number` Margin on top and bottom (default: 0)
### Returns
* `VisualElement` self
## VisualElement:center()
Centers the element within its parent both horizontally and vertically
### Returns
* `VisualElement` self
## VisualElement:toRight(gap?)
Aligns the element's right edge to its parent's right edge with optional gap
### Parameters
* `gap` *(optional)* `number` Gap from the edge (default: 0)
### Returns
* `VisualElement` self
## VisualElement:toLeft(gap?)
Aligns the element's left edge to its parent's left edge with optional gap
### Parameters
* `gap` *(optional)* `number` Gap from the edge (default: 0)
### Returns
* `VisualElement` self
## VisualElement:toTop(gap?)
Aligns the element's top edge to its parent's top edge with optional gap
### Parameters
* `gap` *(optional)* `number` Gap from the edge (default: 0)
### Returns
* `VisualElement` self
## VisualElement:toBottom(gap?)
Aligns the element's bottom edge to its parent's bottom edge with optional gap
### Parameters
* `gap` *(optional)* `number` Gap from the edge (default: 0)
### Returns
* `VisualElement` self
## VisualElement:isInBounds(x, y)
Checks if the specified coordinates are within the bounds of the element
@@ -58,6 +399,31 @@ Checks if the specified coordinates are within the bounds of the element
### Returns
* `boolean` `isInBounds` Whether the coordinates are within the bounds of the element
## VisualElement:setFocused(focused, internal?)
Sets or removes focus from this element
### Parameters
* `focused` `boolean` Whether to focus or blur
* `internal` *(optional)* `boolean` Internal flag to prevent parent notification
### Returns
* `VisualElement` self
## VisualElement:isFocused()
Gets whether this element is focused
### Returns
* `boolean` isFocused
## VisualElement:isFocused()
Gets whether this element is focused
### Returns
* `boolean` isFocused
## VisualElement:addBorder(colorOrOptions)
Adds or updates a drawable character border around the element using the canvas plugin.