Files
Basalt/docs/objects/Progressbar.md
Robert Jelic bb1b1beb79 Basalt 1.7 Update
- New Objects (Flexbox, Graph, Treeview)
- Pluginsystem to add/remove functionality
- Reworked the entire Object system, instead of one big Object Class we have multiple classes: Object, VisualObject, ChangeableObject
- Instead of one big Frame Class we have multiple Frame Classes: BaseFrame, Frame, MovableFrame, ScrollableFrame, MonitorFrame, Flexbox
- Removed the Animation Object, and added a animation plugin instead
- Removed the Graphic Object and merged it's functionality with the image object
- Updated currently existing objects
2023-04-30 17:05:34 +02:00

1.5 KiB

Progressbars are objects that visually display the current state of your progress. They always represent progress as a percentage (0 to 100%), regardless of their size. To represent progress in other units, you need to perform a simple conversion: currentValue / maxValue * 100.

In addition to the Object and VisualObject methods, Progressbar objects have the following methods:

setDirection Sets the progress direction
setProgress Sets the current progress
getProgress Returns the current progress
setProgressBar Changes the progress design
setBackgroundSymbol Sets the background symbol

Events

This is a list of all available events for progressbars:

onDone Fires when progress has reached 100%

Example

Here's an example of how to create a Progressbar object and set its properties:

local mainFrame = basalt.createFrame()
local progressBar = mainFrame:addProgressbar()

progressBar:setDirection("right")
progressBar:setProgress(50)
progressBar:setProgressBar(colors.blue)

progressBar:onDone(function()
  basalt.log("Progress completed")
end)

This example demonstrates how to create a Progressbar object, set its direction, progress, design, and background symbol, and handle the onDone event.