Docs: Basalt.setVariable.md
This commit is contained in:
@@ -1,17 +1,24 @@
|
|||||||
## basalt.setVariable
|
|
||||||
|
# basalt.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.
|
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
|
|
||||||
1. `any` any variable
|
1. `string` a key name
|
||||||
|
2. `any` any variable
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
#### Usage:
|
|
||||||
* Adds a function to basalt.
|
* Adds a function to basalt.
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
basalt.setVariable("clickMe", function()
|
basalt.setVariable("clickMe", function()
|
||||||
basalt.debug("I got clicked")
|
basalt.debug("I got clicked")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<button onClick="clickMe" text="Click me" />
|
<button onClick="clickMe" text="Click me" />
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user