Docs 1.6
Accidentally uploaded outdated 1.6 docs
This commit is contained in:
12
docs/docs1_6/objects/Timer/cancel.md
Normal file
12
docs/docs1_6/objects/Timer/cancel.md
Normal file
@@ -0,0 +1,12 @@
|
||||
## cancel
|
||||
Cancels the timer
|
||||
|
||||
#### Returns:
|
||||
1. `object` The object
|
||||
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aTimer = mainFrame:addTimer()
|
||||
aTimer:setTime(2):start()
|
||||
aTimer:cancel()
|
||||
```
|
||||
35
docs/docs1_6/objects/Timer/onCall.md
Normal file
35
docs/docs1_6/objects/Timer/onCall.md
Normal file
@@ -0,0 +1,35 @@
|
||||
## onCall
|
||||
`onCall(self)`<br>
|
||||
A custom event which gets triggered as soon as the current timer has finished
|
||||
|
||||
|
||||
Here is a example on how to add a onCall event to your timer:
|
||||
|
||||
```lua
|
||||
local basalt = require("basalt")
|
||||
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aTimer = mainFrame:addTimer()
|
||||
|
||||
function call()
|
||||
basalt.debug("The timer has finished!")
|
||||
end
|
||||
aTimer:onCall(call)
|
||||
:setTime(2)
|
||||
:start()
|
||||
```
|
||||
|
||||
Here is also a example how this is done with xml:
|
||||
|
||||
```lua
|
||||
local basalt = require("basalt")
|
||||
|
||||
local mainFrame = basalt.createFrame()
|
||||
|
||||
basalt.setVariable("call", function()
|
||||
basalt.debug("The timer has finished!")
|
||||
end)
|
||||
```
|
||||
```xml
|
||||
<timer onCall="call" time="2" start="true"/>
|
||||
```
|
||||
18
docs/docs1_6/objects/Timer/setTime.md
Normal file
18
docs/docs1_6/objects/Timer/setTime.md
Normal file
@@ -0,0 +1,18 @@
|
||||
## setTime
|
||||
sets the time the timer should wait after calling your function
|
||||
|
||||
#### Parameters:
|
||||
1. `number` the time to delay
|
||||
2. `number` how often it should be repeated -1 is infinite
|
||||
|
||||
#### Returns:
|
||||
1. `object` The object
|
||||
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aTimer = mainFrame:addTimer()
|
||||
aTimer:setTime(2)
|
||||
```
|
||||
```xml
|
||||
<timer time="2" repeat="1"/>
|
||||
```
|
||||
14
docs/docs1_6/objects/Timer/start.md
Normal file
14
docs/docs1_6/objects/Timer/start.md
Normal file
@@ -0,0 +1,14 @@
|
||||
## start
|
||||
Starts the timer
|
||||
|
||||
#### Returns:
|
||||
1. `object` The object
|
||||
|
||||
```lua
|
||||
local mainFrame = basalt.createFrame()
|
||||
local aTimer = mainFrame:addTimer()
|
||||
aTimer:setTime(2):start()
|
||||
```
|
||||
```xml
|
||||
<timer time="2" start="true"/>
|
||||
```
|
||||
Reference in New Issue
Block a user