2025-03-14 20:29:05 +02:00

3.1 KiB

druid.progress API

at /druid/extended/progress.lua

Functions

Fields

init


progress:init(node, key, [init_value])
  • Parameters:
    • node (string|node): Node name or GUI Node itself.
    • key (string): Progress bar direction: const.SIDE.X or const.SIDE.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 a progress bar and stop progress animation

empty


progress:empty()

Empty a progress bar

set_to


progress:set_to(to)

Instant fill progress bar to value

  • Parameters:
    • to (number): Progress bar value, from 0 to 1

get


progress:get()

Return current progress bar value

  • Returns:
    • `` (number):

set_steps


progress: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

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

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:

    • Progress (druid.progress):

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)