deploy: 487409b31a
This commit is contained in:
@@ -1,101 +0,0 @@
|
||||
# Animation
|
||||
This is the animation plugin. It provides a animation system for visual elements
|
||||
with support for sequences, easing functions, and multiple animation types.
|
||||
|
||||
## Functions
|
||||
|
||||
|Method|Returns|Description|
|
||||
|---|---|---|
|
||||
|[Animation.new](#animation-new)|Animation|Creates a new animation
|
||||
|[Animation.registerAnimation](#animation-registeranimation)|-|Registers a custom animation type
|
||||
|[Animation.registerEasing](#animation-registereasing)|-|Adds a custom easing function
|
||||
|[Animation:addAnimation](#animation-addanimation)|-|Adds a new animation to the sequence
|
||||
|[Animation:event](#animation-event)|-|The event handler for the animation
|
||||
|[Animation:onComplete](#animation-oncomplete)|Animation|Registers a callback for the complete event
|
||||
|[Animation:onStart](#animation-onstart)|-|Registers a callback for the start event
|
||||
|[Animation:onUpdate](#animation-onupdate)|Animation|Registers a callback for the update event
|
||||
|[Animation:sequence](#animation-sequence)|Animation|Creates a new sequence
|
||||
|[Animation:start](#animation-start)|Animation|Starts the animation
|
||||
|
||||
|
||||
## Animation.new(element)
|
||||
Creates a new Animation
|
||||
|
||||
### Parameters
|
||||
* `element` `VisualElement` The element to animate
|
||||
|
||||
### Returns
|
||||
* `Animation` `The` new animation
|
||||
|
||||
## Animation.registerAnimation(name, handlers)
|
||||
Registers a new animation type
|
||||
|
||||
### Parameters
|
||||
* `name` `string` The name of the animation
|
||||
* `handlers` `table` Table containing start, update and complete handlers
|
||||
|
||||
### Usage
|
||||
```lua
|
||||
Animation.registerAnimation("fade", {start=function(anim) end, update=function(anim,progress) end})
|
||||
```
|
||||
|
||||
## Animation.registerEasing(name, func)
|
||||
Registers a new easing function
|
||||
|
||||
### Parameters
|
||||
* `name` `string` The name of the easing function
|
||||
* `func` `function` The easing function (takes progress 0-1, returns modified progress)
|
||||
|
||||
## Animation:addAnimation(type, args, duration, easing)
|
||||
Adds a new animation to the sequence
|
||||
|
||||
### Parameters
|
||||
* `type` `string` The type of animation
|
||||
* `args` `table` The animation arguments
|
||||
* `duration` `number` The duration in seconds
|
||||
* `easing` `string` The easing function name
|
||||
|
||||
## Animation:event(event, timerId)
|
||||
The event handler for the animation (listens to timer events)
|
||||
|
||||
### Parameters
|
||||
* `event` `string` The event type
|
||||
* `timerId` `number` The timer ID
|
||||
|
||||
## Animation:onComplete(callback)
|
||||
Registers a callback for the complete event
|
||||
|
||||
### Parameters
|
||||
* `callback` `function` The callback function to register
|
||||
|
||||
### Returns
|
||||
* `Animation` `self` The animation instance
|
||||
|
||||
## Animation:onStart(callback)
|
||||
Registers a callback for the start event
|
||||
|
||||
### Parameters
|
||||
* `callback` `function` The callback function to register
|
||||
|
||||
## Animation:onUpdate(callback)
|
||||
Registers a callback for the update event
|
||||
|
||||
### Parameters
|
||||
* `callback` `function` The callback function to register
|
||||
|
||||
### Returns
|
||||
* `Animation` `self` The animation instance
|
||||
|
||||
## Animation:sequence()
|
||||
Creates a new sequence
|
||||
|
||||
### Returns
|
||||
* `Animation` `self` The animation instance
|
||||
|
||||
## Animation:start()
|
||||
Starts the animation
|
||||
|
||||
### Returns
|
||||
* `Animation` `self` The animation instance
|
||||
|
||||
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
# Benchmark
|
||||
This is the benchmark plugin. It provides performance measurement tools for elements and methods,
|
||||
with support for hierarchical profiling and detailed statistics. The plugin is meant to be used for very big projects
|
||||
where performance is critical. It allows you to measure the time taken by specific methods and log the results.
|
||||
|
||||
## Functions
|
||||
|
||||
|Method|Returns|Description|
|
||||
|---|---|---|
|
||||
|[API.clear](#api-clear)|-|Removes a benchmark's data
|
||||
|[API.clearAll](#api-clearall)|-|Removes all custom benchmark data
|
||||
|[API.getStats](#api-getstats)|table?|Retrieves benchmark statistics
|
||||
|[API.start](#api-start)|-|Starts timing a custom operation
|
||||
|[API.stop](#api-stop)|-|Stops timing and logs results
|
||||
|
||||
|
||||
## API.clear(name)
|
||||
Clears a specific benchmark
|
||||
|
||||
### Parameters
|
||||
* `name` `string` The name of the benchmark to clear
|
||||
|
||||
## API.clearAll()
|
||||
Clears all custom benchmarks
|
||||
|
||||
## API.getStats(name)
|
||||
Gets statistics for a benchmark
|
||||
|
||||
### Parameters
|
||||
* `name` `string` The name of the benchmark
|
||||
|
||||
### Returns
|
||||
* `table?` `stats` The benchmark statistics or nil
|
||||
|
||||
## API.start(name, options?)
|
||||
Starts a custom benchmark
|
||||
|
||||
### Parameters
|
||||
* `name` `string` The name of the benchmark
|
||||
* `options` *(optional)* `table` Optional configuration
|
||||
|
||||
## API.stop(name)
|
||||
Stops a custom benchmark
|
||||
|
||||
### Parameters
|
||||
* `name` `string` The name of the benchmark to stop
|
||||
|
||||
|
||||
|
||||
0
docs/references/plugins/canvas.md
Normal file
0
docs/references/plugins/canvas.md
Normal file
@@ -1,78 +0,0 @@
|
||||
# BaseElement
|
||||
No Description
|
||||
|
||||
## Functions
|
||||
|
||||
|Method|Returns|Description|
|
||||
|---|---|---|
|
||||
|[BaseElement.debug](#baseelement-debug)|-|Enables debugging for this element
|
||||
|[BaseElement.dumpDebug](#baseelement-dumpdebug)|-|Dumps debug information
|
||||
|
||||
|
||||
## BaseElement.debug(self, level)
|
||||
Enables debugging for this element
|
||||
|
||||
### Parameters
|
||||
* `self` `BaseElement` The element to debug
|
||||
* `level` `number` The debug level
|
||||
|
||||
## BaseElement.dumpDebug(self)
|
||||
Dumps debug information for this element
|
||||
|
||||
### Parameters
|
||||
* `self` `BaseElement` The element to dump debug info for
|
||||
|
||||
|
||||
---
|
||||
<br>
|
||||
|
||||
# BaseFrame
|
||||
|
||||
## Functions
|
||||
|
||||
|Method|Returns|Description|
|
||||
|---|---|---|
|
||||
|[BaseFrame.closeConsole](#baseframe-closeconsole)|-|Hides the debug log frame
|
||||
|[BaseFrame.openConsole](#baseframe-openconsole)|-|Shows the debug log frame
|
||||
|[BaseFrame.toggleConsole](#baseframe-toggleconsole)|-|Toggles the debug log frame
|
||||
|
||||
|
||||
## BaseFrame.closeConsole(self)
|
||||
Hides the debug log frame
|
||||
|
||||
### Parameters
|
||||
* `self` `BaseFrame` The frame to hide debug log for
|
||||
|
||||
## BaseFrame.openConsole(self)
|
||||
Shows the debug log frame
|
||||
|
||||
### Parameters
|
||||
* `self` `BaseFrame` The frame to show debug log in
|
||||
|
||||
## BaseFrame.toggleConsole(self)
|
||||
Toggles the debug log frame
|
||||
|
||||
### Parameters
|
||||
* `self` `BaseFrame` The frame to toggle debug log for
|
||||
|
||||
|
||||
---
|
||||
<br>
|
||||
|
||||
# Container
|
||||
|
||||
## Functions
|
||||
|
||||
|Method|Returns|Description|
|
||||
|---|---|---|
|
||||
|[Container.debugChildren](#container-debugchildren)|-|Debug container and children
|
||||
|
||||
|
||||
## Container.debugChildren(self, level)
|
||||
Enables debugging for this container and all its children
|
||||
|
||||
### Parameters
|
||||
* `self` `Container` The container to debug
|
||||
* `level` `number` The debug level
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
# Reactive
|
||||
This module provides reactive functionality for elements, it adds no new functionality for elements.
|
||||
It is used to evaluate expressions in property values and update the element when the expression changes.
|
||||
|
||||
### Usage
|
||||
```lua
|
||||
local button = main:addButton({text="Exit"})
|
||||
button:setX("{parent.x - 12}")
|
||||
button:setBackground("{self.clicked and colors.red or colors.green}")
|
||||
button:setWidth("{self.text:len() + 2}")
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
# BaseElement
|
||||
This is the state plugin. It provides a state management system for UI elements with support for
|
||||
persistent states, computed states, and state sharing between elements.
|
||||
|
||||
## Functions
|
||||
|
||||
|Method|Returns|Description|
|
||||
|---|---|---|
|
||||
|[BaseElement:bind](#baseelement-bind)|BaseElement|
|
||||
|[BaseElement:computed](#baseelement-computed)|-|
|
||||
|[BaseElement:getState](#baseelement-getstate)|any|Gets a state value
|
||||
|[BaseElement:onStateChange](#baseelement-onstatechange)|BaseElement|Watches for state changes
|
||||
|[BaseElement:removeStateChange](#baseelement-removestatechange)|BaseElement|Removes a state change observer
|
||||
|[BaseElement:setState](#baseelement-setstate)|BaseElement|Sets a state value
|
||||
|
||||
|
||||
## BaseElement:bind(self, propertyName, stateName)
|
||||
Binds a property to a state
|
||||
|
||||
### Parameters
|
||||
* `self` `BaseElement` The element to bind
|
||||
* `propertyName` `string` The property to bind
|
||||
* `stateName` `string` The state to bind to (optional, uses propertyName if not provided)
|
||||
|
||||
### Returns
|
||||
* `BaseElement` `self` The element instance
|
||||
|
||||
## BaseElement:computed()
|
||||
|
||||
## BaseElement:getState(self, name)
|
||||
Gets the value of a state
|
||||
|
||||
### Parameters
|
||||
* `self` `BaseElement` The element to get state from
|
||||
* `name` `string` The name of the state
|
||||
|
||||
### Returns
|
||||
* `any` `value` The current state value
|
||||
|
||||
## BaseElement:onStateChange(self, stateName, callback)
|
||||
Registers a callback for state changes
|
||||
|
||||
### Parameters
|
||||
* `self` `BaseElement` The element to watch
|
||||
* `stateName` `string` The state to watch
|
||||
* `callback` `function` Called with (element, newValue, oldValue)
|
||||
|
||||
### Returns
|
||||
* `BaseElement` `self` The element instance
|
||||
|
||||
## BaseElement:removeStateChange(self, stateName, callback)
|
||||
Removes a state change observer
|
||||
|
||||
### Parameters
|
||||
* `self` `BaseElement` The element to remove observer from
|
||||
* `stateName` `string` The state to remove observer from
|
||||
* `callback` `function` The callback function to remove
|
||||
|
||||
### Returns
|
||||
* `BaseElement` `self` The element instance
|
||||
|
||||
## BaseElement:setState(self, name, value)
|
||||
Sets the value of a state
|
||||
|
||||
### Parameters
|
||||
* `self` `BaseElement` The element to set state for
|
||||
* `name` `string` The name of the state
|
||||
* `value` `any` The new value for the state
|
||||
|
||||
### Returns
|
||||
* `BaseElement` `self` The element instance
|
||||
|
||||
|
||||
---
|
||||
<br>
|
||||
|
||||
# BaseFrame : Container
|
||||
|
||||
## Functions
|
||||
|
||||
|Method|Returns|Description|
|
||||
|---|---|---|
|
||||
|[BaseFrame.setup](#baseframe-setup)|-|
|
||||
|[BaseFrame:initializeState](#baseframe-initializestate)|BaseFrame|Initializes a new state
|
||||
|
||||
|
||||
## BaseFrame.setup()
|
||||
|
||||
## BaseFrame:initializeState(self, name, default, persist?, path?)
|
||||
Initializes a new state for this element
|
||||
|
||||
### Parameters
|
||||
* `self` `BaseFrame` The element to initialize state for
|
||||
* `name` `string` The name of the state
|
||||
* `default` `any` The default value of the state
|
||||
* `persist` *(optional)* `boolean` Whether to persist the state to disk
|
||||
* `path` *(optional)* `string` Custom file path for persistence
|
||||
|
||||
### Returns
|
||||
* `BaseFrame` `self` The element instance
|
||||
|
||||
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
# BaseElement
|
||||
This is the theme plugin. It provides a theming system that allows for consistent styling across elements
|
||||
with support for inheritance, named styles, and dynamic theme switching.
|
||||
|
||||
## Functions
|
||||
|
||||
|Method|Returns|Description|
|
||||
|---|---|---|
|
||||
|[BaseElement:applyTheme](#baseelement-applytheme)|BaseElement|Applies theme styles to the element
|
||||
|[BaseElement:getTheme](#baseelement-gettheme)|table|Gets theme properties for the element
|
||||
|
||||
|
||||
## BaseElement:applyTheme(self, applyToChildren)
|
||||
Applies the current theme to this element
|
||||
|
||||
### Parameters
|
||||
* `self` `BaseElement` The element to apply theme to
|
||||
* `applyToChildren` `boolean?` Whether to apply theme to child elements (default: true)
|
||||
|
||||
### Returns
|
||||
* `BaseElement` `self` The element instance
|
||||
|
||||
## BaseElement:getTheme(self)
|
||||
Gets the theme properties for this element
|
||||
|
||||
### Parameters
|
||||
* `self` `BaseElement` The element to get theme for
|
||||
|
||||
### Returns
|
||||
* `table` `styles` The theme properties
|
||||
|
||||
|
||||
---
|
||||
<br>
|
||||
|
||||
# ThemeAPI
|
||||
The Theme API provides methods for managing themes globally
|
||||
|
||||
## Functions
|
||||
|
||||
|Method|Returns|Description|
|
||||
|---|---|---|
|
||||
|[ThemeAPI.getTheme](#themeapi-gettheme)|table|Gets the current theme
|
||||
|[ThemeAPI.loadTheme](#themeapi-loadtheme)|-|Loads theme from JSON file
|
||||
|[ThemeAPI.setTheme](#themeapi-settheme)|-|Sets a new theme
|
||||
|
||||
|
||||
## ThemeAPI.getTheme()
|
||||
Gets the current theme configuration
|
||||
|
||||
### Returns
|
||||
* `table` `theme` The current theme configuration
|
||||
|
||||
## ThemeAPI.loadTheme(path)
|
||||
Loads a theme from a JSON file
|
||||
|
||||
### Parameters
|
||||
* `path` `string` Path to the theme JSON file
|
||||
|
||||
## ThemeAPI.setTheme(newTheme)
|
||||
Sets the current theme
|
||||
|
||||
### Parameters
|
||||
* `newTheme` `table` The theme configuration to set
|
||||
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
# Container
|
||||
|
||||
## Functions
|
||||
|
||||
|Method|Returns|Description|
|
||||
|---|---|---|
|
||||
|[Container:loadXML](#Container:loadXML)|Container|Loads UI from XML string
|
||||
|
||||
|
||||
## Container:loadXML(self, content, scope?)
|
||||
Loads and creates UI elements from XML content
|
||||
local xml = [[
|
||||
<Frame>
|
||||
<Button name="myButton" x="5" y="5"/>
|
||||
</Frame>
|
||||
]]
|
||||
container:loadXML(xml)
|
||||
|
||||
### Parameters
|
||||
* `self` `Container` The container to load into
|
||||
* `content` `string` The XML content to parse
|
||||
* `scope` *(optional)* `table` Optional scope for variable resolution
|
||||
|
||||
### Returns
|
||||
* `Container` `self` The container instance
|
||||
|
||||
### Usage
|
||||
```lua
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user