# 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=0[, callback]]) | Component init function
set_to(self, set_to) | Set text to text field
set_state(self, is_on) | Called when update
set_interval(self, from, to) | Set time interval

## Fields

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

## Functions

init(self, node, seconds_from[, seconds_to=0[, callback]])
  Component init function

  ### Parameters:

  - self Timer
  - node node Gui text node
  - seconds_from number Start timer value in seconds
  - seconds_to number End timer value in seconds (default 0)
  - callback function Function on timer end (optional)
set_to(self, set_to)
  Set text to text field

  ### Parameters:

  - self Timer
  - set_to number Value in seconds
set_state(self, is_on)
  Called when update

  ### Parameters:

  - self Timer
  - is_on bool Timer enable state
set_interval(self, from, to)
  Set time interval

  ### Parameters:

  - self Timer
  - from number Start time in seconds
  - to number Target time in seconds

## Fields

on_tick
  On timer tick. Fire every second callback(self, value)
  - on_tick druid_event
on_set_enabled
  On timer change enabled state callback(self, is_enabled)
  - on_set_enabled druid_event
on_timer_end
  On timer end callback
  - on_timer_end druid_event (self, Timer)
node
  Trigger node
  - node node
from
  Initial timer value
  - from number
target
  Target timer value
  - target number
value
  Current timer value
  - value number

generated by LDoc 1.4.6 Last updated 2022-02-12 17:16:44