Module Timer

Component to handle GUI timers.

Timer updating by game delta time. If game is not focused - timer will be not updated.

Functions

init(self, node, seconds_from, seconds_to, callback) The Timer constructor
set_interval(self, from, to) Set time interval
set_state(self, is_on) Called when update
set_to(self, set_to) Set text to text field

Fields

from Initial timer value
node Trigger node
on_set_enabled On timer change enabled state callback(self, is_enabled)
on_tick On timer tick.
on_timer_end On timer end callback
target Target timer value
value Current timer value


Functions

init(self, node, seconds_from, seconds_to, callback)
The Timer constructor

Parameters:

  • self Timer Timer
  • node node Gui text node
  • seconds_from number or nil Start timer value in seconds
  • seconds_to number or nil End timer value in seconds
  • callback function or nil Function on timer end
set_interval(self, from, to)
Set time interval

Parameters:

  • self Timer Timer
  • from number Start time in seconds
  • to number Target time in seconds
set_state(self, is_on)
Called when update

Parameters:

  • self Timer Timer
  • is_on boolean or nil Timer enable state
set_to(self, set_to)
Set text to text field

Parameters:

  • self Timer Timer
  • set_to number Value in seconds

Fields

from
Initial timer value
  • from number
node
Trigger node
on_set_enabled
On timer change enabled state callback(self, is_enabled)
on_tick
On timer tick. Fire every second callback(self, value)
on_timer_end
On timer end callback
  • on_timer_end DruidEvent (self, Timer) DruidEvent
target
Target timer value
  • target number
value
Current timer value
  • value number
generated by LDoc TESTING Last updated 2015-01-01 12:00:00