mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 18:37:44 +02:00
3.6 KiB
3.6 KiB
druid.progress API
at /druid/extended/progress.lua
The component used to manage a node as a progress bar, changing the size and scale of the node
Functions
- init
- on_style_change
- on_layout_change
- on_remove
- update
- fill
- empty
- set_to
- get
- set_steps
- to
- set_max_size
Fields
- node
- on_change
- style
- key
- prop
- scale
- size
- max_size
- slice
- last_value
- slice_size
- target
- steps
- step_callback
- target_callback
init
progress:init(node, key, [init_value])
- Parameters:
node
(string|node): Node name or GUI Node itself.key
(string): Progress bar direction: "x" or "y"[init_value]
(number|nil): Initial value of progress bar. Default: 1
on_style_change
progress:on_style_change(style)
- Parameters:
style
(druid.progress.style):
on_layout_change
progress:on_layout_change()
on_remove
progress:on_remove()
update
progress:update(dt)
- Parameters:
dt
(number): Delta time
fill
progress:fill()
Fill the progress bar
- Returns:
self
(druid.progress): Current progress instance
empty
progress:empty()
Empty the progress bar
- Returns:
self
(druid.progress): Current progress instance
set_to
progress:set_to(to)
Instant fill progress bar to value
-
Parameters:
to
(number): Progress bar value, from 0 to 1
-
Returns:
self
(druid.progress): Current progress instance
get
progress:get()
Return the current value of the progress bar
- Returns:
value
(number): The current value of the progress bar
set_steps
progress:set_steps(steps, callback)
Set points on progress bar to fire the callback
-
Parameters:
steps
(number[]): Array of progress bar valuescallback
(function): Callback on intersect step value
-
Returns:
self
(druid.progress): Current progress instance
to
progress:to(to, [callback])
Start animation of a progress bar
-
Parameters:
to
(number): value between 0..1[callback]
(function|nil): Callback on animation ends
-
Returns:
self
(druid.progress): Current progress instance
set_max_size
progress:set_max_size(max_size)
Set progress bar max node size
-
Parameters:
max_size
(vector3): The new node maximum (full) size
-
Returns:
self
(druid.progress): Current progress instance
Fields
- node (node)
- on_change (event)
- style (druid.progress.style)
- key (string)
- prop (hash)
- scale (unknown)
- size (unknown)
- max_size (unknown)
- slice (unknown)
- last_value (number)
- slice_size (unknown)
- target (nil)
- steps (number[])
- step_callback (function)
- target_callback (function|nil)