# Defold Druid UI Library

# Module `druid.timer`

Component to handle GUI timers.

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

## Functions

init(node, seconds_from[, seconds_to=0[, callback]]) | Component init function
set_to(set_to) | Set text to text field
set_state(is_on) | Called when update
set_interval(from, to) | Set time interval

## Tables

Events | Component events
Fields | Component fields

## Functions

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

  ### Parameters:

  - 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(set_to)
  Set text to text field

  ### Parameters:

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

  ### Parameters:

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

  ### Parameters:

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

## Tables

Events
  Component events

  ### Fields:

  - on_tick druid_event On timer tick callback. Fire every second
  - on_set_enabled druid_event On timer change enabled state callback
  - on_timer_end druid_event On timer end callback
Fields
  Component fields

  ### Fields:

  - node node Trigger node
  - from number Initial timer value
  - target number Target timer value
  - value number Current timer value

generated by LDoc 1.4.6 Last updated 2020-06-14 20:13:02