# Module `Progress`

Basic progress bar component.

For correct progress bar init it should be in max size from gui

## Functions

init(self, node, key[, init_value=1]) | Component init function
fill(self) | Fill a progress bar and stop progress animation
empty(self) | Empty a progress bar
set_to(self, to) | Instant fill progress bar to value
get(self) | Return current progress bar value
set_steps(self, steps, callback) | Set points on progress bar to fire the callback
to(self, to[, callback]) | Start animation of a progress bar

## Tables

style | Component style params.

## Fields

on_change | On progress bar change callback(self, new_value)
node | Progress bar fill node
key | The progress bar direction
scale | Current progress bar scale
size | Current progress bar size
max_size | Maximum size of progress bar
slice | Progress bar slice9 settings

## Functions

init(self, node, key[, init_value=1])
  Component init function

  ### Parameters:

  - self Progress
  - node string or node Progress bar fill node or node name
  - key string Progress bar direction: const.SIDE.X or const.SIDE.Y
  - init_value number Initial value of progress bar (default 1)
fill(self)
  Fill a progress bar and stop progress animation

  ### Parameters:

  - self Progress
empty(self)
  Empty a progress bar

  ### Parameters:

  - self Progress
set_to(self, to)
  Instant fill progress bar to value

  ### Parameters:

  - self Progress
  - to number Progress bar value, from 0 to 1
get(self)
  Return current progress bar value

  ### Parameters:

  - self Progress
set_steps(self, steps, callback)
  Set points on progress bar to fire the callback

  ### Parameters:

  - self Progress
  - steps number[] Array of progress bar values
  - callback function Callback on intersect step value

  ### Usage:

      progress:set_steps({0, 0.3, 0.6, 1}, function(self, step) end)

to(self, to[, callback])
  Start animation of a progress bar

  ### Parameters:

  - self Progress
  - to number value between 0..1
  - callback function Callback on animation ends (optional)

## Tables

style
  Component style params. You can override this component styles params in druid styles table or create your own style

  ### Fields:

  - SPEED number Progress bas fill rate. More -> faster (default 5)
  - MIN_DELTA number Minimum step to fill progress bar (default 0.005)

## Fields

on_change
  On progress bar change callback(self, new_value)
  - on_change druid_event
node
  Progress bar fill node
  - node node
key
  The progress bar direction
  - key string
scale
  Current progress bar scale
  - scale vector3
size
  Current progress bar size
  - size vector3
max_size
  Maximum size of progress bar
  - max_size number
slice
  Progress bar slice9 settings
  - slice vector4

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