Module druid.progress
Basic progress bar component.
For correct progress bar init it should be in max size from gui
Functions
init(node, key, init_value) | Component init function |
fill() | Fill a progress bar and stop progress animation |
empty() | Empty a progress bar |
set_to(to) | Instant fill progress bar to value |
get() | Return current progress bar value |
set_steps(steps, callback) | Set points on progress bar to fire the callback |
to(to[, callback]) | Start animation of a progress bar |
Tables
Events | Component events |
Fields | Component fields |
Style | Component style params |
Functions
- init(node, key, init_value)
-
Component init function
Parameters:
- fill()
- Fill a progress bar and stop progress animation
- empty()
- Empty a progress bar
- set_to(to)
-
Instant fill progress bar to value
Parameters:
- to number Progress bar value, from 0 to 1
- get()
- Return current progress bar value
- set_steps(steps, callback)
-
Set points on progress bar to fire the callback
Parameters:
- 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(to[, callback])
-
Start animation of a progress bar
Parameters:
- to number value between 0..1
- callback function Callback on animation ends (optional)
Tables
- Events
-
Component events
Fields:
- on_change druid_event On progress bar change callback
- Fields
-
Component fields
Fields:
- node node Progress bar fill node
- key string The progress bar direction
- scale vector3 Current progress bar scale
- size vector3 Current progress bar size
- max_size number Maximum size of progress bar
- slice vector4 Progress bar slice9 settings
- Style
-
Component style params
Fields:
- SPEED number Progress bas fill rate. More -> faster
- MIN_DELTA number Minimum step to fill progress bar