Skip to content

ProgressBar : VisualElement

This is the progress bar class. It provides a visual representation of progress with optional percentage display and customizable colors.

Usage

lua
local progressBar = main:addProgressBar()
progressBar:setDirection("up") 
progressBar:setProgress(50)
local progressBar = main:addProgressBar()
progressBar:setDirection("up") 
progressBar:setProgress(50)

Properties

PropertyTypeDefaultDescription
progressnumber0Current progress value (0-100)
showPercentagebooleanfalseWhether to show the percentage text in the center
progressColorcolorlimeThe color used for the filled portion of the progress bar
directionstringrightThe direction of the progress bar ("up", "down", "left", "right")

Protected Functions

MethodReturnsDescription
ProgressBar:initProgressBarInitializes the ProgressBar instance
ProgressBar:render-Renders the progress bar with filled portion and optional percentage text

Released under the MIT License.