diff --git a/docs/references/elements/Container.md b/docs/references/elements/Container.md index 2cba919..5215367 100644 --- a/docs/references/elements/Container.md +++ b/docs/references/elements/Container.md @@ -21,7 +21,7 @@ like Frames, BaseFrames, and more. |Name|Properties|Description| |---|---|---| -|offset|`offsetX offsetY`|Combined property for offsetX and offsetY| +|offset|`offsetX number, offsetY number`|Combined property for offsetX and offsetY| ## Functions diff --git a/docs/references/main.md b/docs/references/main.md index 412994c..c98f181 100644 --- a/docs/references/main.md +++ b/docs/references/main.md @@ -1,4 +1,4 @@ -# Basalt +# basalt This is the UI Manager and the starting point for your project. The following functions allow you to influence the default behavior of Basalt. Before you can access Basalt, you need to add the following code on top of your file: @@ -18,6 +18,7 @@ What this code does is it loads basalt into the project, and you can access it b |_events|`table`|A table of events and their callbacks| |_schedule|`function[]`|A table of scheduled functions| |_plugins|`table`|A table of plugins| +|isRunning|`boolean`|Whether the Basalt runtime is active| |LOGGER|`Log`|The logger instance| |path|`string`|The path to the Basalt library| @@ -26,8 +27,9 @@ What this code does is it loads basalt into the project, and you can access it b |Method|Returns|Description| |---|---|---| |[basalt.create](#basalt.create)|table|Creates a new UI element -|[basalt.createFrame](#basalt.createFrame)|table|Creates a new BaseFrame +|[basalt.createFrame](#basalt.createFrame)|BaseFrame|Creates a new BaseFrame |[basalt.getAPI](#basalt.getAPI)|table|Returns a Plugin API +|[basalt.getActiveFrame](#basalt.getActiveFrame)|BaseFrame?|Returns the active frame |[basalt.getElementClass](#basalt.getElementClass)|table|Returns an element class |[basalt.getElementManager](#basalt.getElementManager)|table|Returns the element manager |[basalt.getMainFrame](#basalt.getMainFrame)|BaseFrame|Gets or creates the main frame @@ -58,7 +60,7 @@ local button = basalt.create("Button") Creates and returns a new BaseFrame ### Returns -* `table` `BaseFrame` The created frame instance +* `BaseFrame` `BaseFrame` The created frame instance ### Usage ```lua @@ -74,6 +76,17 @@ Returns a Plugin API ### Returns * `table` `Plugin` The plugin API +## basalt.getActiveFrame() +Returns the active frame + +### Returns +* `BaseFrame?` `BaseFrame` The frame to set as active + +### Usage + ```lua +local frame = basalt.getActiveFrame() +``` + ## basalt.getElementClass(name) Returns an element's class without creating a instance @@ -98,7 +111,7 @@ local manager = basalt.getElementManager() Gets or creates the main frame ### Returns -* `BaseFrame` `table` The main frame instance +* `BaseFrame` `BaseFrame` The main frame instance ### Usage ```lua @@ -149,7 +162,7 @@ local id = basalt.scheduleUpdate(myFunction) Sets the active frame ### Parameters -* `frame` `table` The frame to set as active +* `frame` `BaseFrame` The frame to set as active ### Usage ```lua diff --git a/docs/references/plugins/benchmark_Container : VisualElement.md b/docs/references/plugins/benchmark_Container : VisualElement.md new file mode 100644 index 0000000..28f226a --- /dev/null +++ b/docs/references/plugins/benchmark_Container : VisualElement.md @@ -0,0 +1,44 @@ +# Container : VisualElement + +## Functions + +|Method|Returns|Description| +|---|---|---| +|[Container:benchmarkContainer](#Container:benchmarkContainer)|Container|Recursively enables benchmarking +|[Container:logContainerBenchmarks](#Container:logContainerBenchmarks)|Container|Recursively logs benchmark statistics +|[Container:stopContainerBenchmark](#Container:stopContainerBenchmark)|Container|Recursively stops benchmarking + + +## Container:benchmarkContainer(methodName) +Enables benchmarking for a container and all its children + +### Parameters +* `methodName` `string` The method to benchmark + +### Returns +* `Container` `self` The container instance + +### Usage + ```lua +container:benchmarkContainer("render") +``` + +## Container:logContainerBenchmarks(methodName) +Logs benchmark statistics for a container and all its children + +### Parameters +* `methodName` `string` The method to log + +### Returns +* `Container` `self` The container instance + +## Container:stopContainerBenchmark(methodName) +Stops benchmarking for a container and all its children + +### Parameters +* `methodName` `string` The method to stop benchmarking + +### Returns +* `Container` `self` The container instance + +