Docs: Fix sidebar issue on all Basalt methods

This commit is contained in:
Erb3
2022-09-17 14:41:54 +02:00
parent bd61da9593
commit 45bb23476b
19 changed files with 80 additions and 56 deletions

View File

@@ -40,7 +40,7 @@
loadSidebar: true,
loadFooter: '_footer.md',
autoHeader: true,
subMaxLevel: 2,
subMaxLevel: 3,
homepage: 'Home.md',
name: 'Basalt',
repo: 'https://github.com/Pyroxenium/Basalt',

View File

@@ -1,13 +1,14 @@
# Basalt
# basalt.autoUpdate
## autoUpdate
This starts the event and draw handler for you. The listeners will run until you stop them.
## Parameters
### Parameters
1. `boolean` optional - if you use false as the first parameter it would stop the listeners. Using false is a synonym for [`basalt.stopUpdate()`](objects/Basalt/stopUpdate.md).
## Usage
### Usage
* Enables the basalt listeners, otherwise the screen will not continue to update

View File

@@ -1,20 +1,21 @@
# Basalt
# basalt.createFrame
## createFrame
Creates a new base-frame, you can have as many base-frames as you want, but only 1 can be active (visible) at the same time.
You can always switch between your base frames.
Only the currently active base-frame listens to incoming events (except for some events like time-events and peripheral-events)
## Parameters
### Parameters
1. `string` id - optional (if you dont set a id it will automatically create a uuid for you)
## Returns
### Returns
1. `frame` object
## Usage
### Usage
* How to use multiple base frames:

View File

@@ -1,5 +1,6 @@
# Basalt
# basalt.debug
## debug
Creates a label with some information on the main frame on the bottom left. When you click on that label it will open a log view for you. See it as the new print for debugging
@@ -8,11 +9,11 @@ which returns the debug Label.
`basalt.debugFrame` and `basalt.debugList` are also available.
## Parameters
### Parameters
1. `...` (multiple parameters are possible, like print does)
## Usage
### Usage
* Prints "Hello! ^-^" to the debug console

View File

@@ -1,13 +1,14 @@
# Basalt
# basalt.getActiveFrame
## getActiveFrame
Returns the currently active/visible base frame.
## Returns
### Returns
1. `frame` The current frame
## Usage
### Usage
* Displays the active frame name in the debug console

View File

@@ -1,17 +1,18 @@
# Basalt
# basalt.getFrame
## getFrame
Returns a base frame by the given id.
## Parameters
### Parameters
1. `string` id
## Returns
### Returns
1. `frame` The frame with the supplied id.
## Usage
### Usage
* Creates, fetches and shows the "myFirstFrame" object

View File

@@ -1,14 +1,15 @@
# Basalt
# basalt.getTheme
## basalt.getTheme
Returns the current base-theme. This base-theme can be set using setTheme.md.
A list of base-theme keys can be found [here](https://github.com/Pyroxenium/Basalt/blob/master/Basalt/theme.lua).
## Returns
### Returns
1. `number` The color of the requested base-theme key.
## Usage
### Usage
* Displays the color of the main background in the debug console

View File

@@ -1,12 +1,14 @@
# basalt.getVariable
# Basalt
## getVariable
Returns a variable defined with [setVariable](objects/Basalt/setVariable)
## Returns
### Returns
1. `variable` The variable stored
## Usage
### Usage
* Displays the stored variable in the debug console

View File

@@ -1,12 +1,14 @@
# basalt.getVersion
# Basalt
## getVersion
Returns the currently active/visible base frame.
## Returns
### Returns
1. `string` The current version of Basalt
## Usage
### Usage
* Displays the version of Basalt in the debug console

View File

@@ -1,17 +1,18 @@
# Basalt
# basalt.isKeyDown
## isKeyDown
Checks if the user is currently holding a key
## Parameters
### Parameters
1. `number` key code (use the [keys table](https://tweaked.cc/module/keys.html) for that)
## Returns
### Returns
1. `boolean` true or false
## Usage
### Usage
* Shows a debug message with true or false if the left ctrl key is down, as soon as you click on the button.

View File

@@ -1,13 +1,15 @@
# basalt.log
# Basalt
## log
This writes something into a file. The main goal is to make debugging errors easier. Lets say you'r program is crashing and you don't know why, you could use basalt.log The log files will automatically removed after you start your program again.
## Parameters
### Parameters
1. `string` The text to write into the log file
2. `string` - optional (default: "Debug") - the type to write
## Usage
### Usage
* Writes "Hello!" into the log file

View File

@@ -1,3 +1,5 @@
# basalt.onEvent
# Basalt
## onEvent
TODO

View File

@@ -1,13 +1,14 @@
# Basalt
# basalt.removeFrame
## removeFrame
Removes the base frame by it's id. **This only works for base-frames.**
## Parameters
### Parameters
1. `string` id - ID of the base-frame.
## Usage
### Usage
* Removes the previously created frame with id "secondBaseFrame"
The frame id is gotten from a frame variable's `:getName()`

View File

@@ -1,17 +1,19 @@
# basalt.schedule
# Basalt
## schedule
Schedules a function which gets called in a coroutine. After the coroutine is finished it will get destroyed immediatly. It's something like threads, but with some limits.
**A guide can be found [here](/tips/logic).**
## Parameters
### Parameters
1. `function` a function which should get executed
## Returns
### Returns
1. `function` it returns the function which you have to execute in order to start the coroutine
## Usage
### Usage
* Creates a schedule which switches the color between red and gray

View File

@@ -1,11 +1,13 @@
# basalt.setActiveFrame
# Basalt
## setActiveFrame
Sets what should be the active baseframe.
## Parameters
### Parameters
1. `frame` frame - The frame that should be the active base-frame.
## Usage
### Usage
TODO

View File

@@ -1,13 +1,14 @@
# Basalt
# basalt.setTheme
## setTheme
Sets the base theme of the project! Make sure to cover all existing objects, otherwise it will result in errors. A good example is [theme](https://github.com/Pyroxenium/Basalt/blob/master/Basalt/theme.lua). The theme can also be gotten with [`basalt.getTheme()`](objects/Basalt/getTheme)
## Parameters
### Parameters
1. `table` theme layout look into [theme](https://github.com/Pyroxenium/Basalt/blob/master/Basalt/theme.lua) for a example
## Usage
### Usage
* Sets the default theme of basalt.

View File

@@ -1,14 +1,15 @@
# Basalt
# basalt.setVariable
## setVariable
This stores a variable which you're able to access via xml. You are also able to add a function, which then gets called by object events created in XML.
## Parameters
### Parameters
1. `string` a key name
2. `any` any variable
## Usage
### Usage
* Adds a function to basalt.

View File

@@ -1,10 +1,11 @@
# Basalt
# basalt.stopUpdate or basalt.stop
## stopUpdate / stop
Stops the automatic draw and event handler which got started by `basalt.autoUpdate()`.
`basalt.autoUpdate(false)` also does the same.
## Usage
### Usage
* When the quit button is clicked, the button stops basalt's event listeners and draw handlers

View File

@@ -1,15 +1,16 @@
# Basalt
# basalt.update
## update
Calls the draw and event handler once - this gives more flexibility about which events basalt should process. For example you could filter the terminate event.
Which means you have to pass the events into basalt.update.
## Parameters
### Parameters
1. `string` The event to be received
2. `...` Additional event variables to capture
## Usage
### Usage
* Creates and starts a custom update cycle