Files
Basalt/docs/objects/Timer/onCall.md
Robert Jelic 4d614372a1 Updated docs
There is still stuff to do
2022-08-28 18:18:26 +02:00

681 B

onCall

onCall(self)
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:

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:

local basalt = require("basalt")

local mainFrame = basalt.createFrame()

basalt.setVariable("call", function()
  basalt.debug("The timer has finished!")
end)
<timer onCall="call" time="2" start="true"/>