Skip to content

ProgressBar ​

Require path: require "ProjectMotionUI/Components/ProgressBar"


Class PMUI.ProgressBar ​

Inherits from: PMUI.BaseElement

Methods & Functions ​

PMUI.ProgressBar:new(minVal, maxVal) ​

Creates a progress bar with the specified value range.

ParameterTypeDescription
minValnumber|nilMinimum progress value. Defaults to 0.
maxValnumber|nilMaximum progress value. Defaults to 100.

Returns: PMUI.ProgressBar

PMUI.ProgressBar:SetRange(minVal, maxVal) ​

Sets the minimum and maximum values of the progress range.

ParameterTypeDescription
minValnumberMinimum progress value.
maxValnumberMaximum progress value.

Returns: PMUI.ProgressBar

PMUI.ProgressBar:SetValue(val, instant) ​

Updates the progress value. The value is clamped to the configured range. When instant is false, the displayed value is animated using QuadOut easing.

ParameterTypeDescription
valnumberTarget progress value.
instantboolean|nilIf true, updates the displayed value immediately.

Returns: PMUI.ProgressBar

PMUI.ProgressBar:SetFillColor(r, g, b, a) ​

Sets the progress fill color.

ParameterTypeDescription
rnumberRed component (0.0-1.0).
gnumberGreen component (0.0-1.0).
bnumberBlue component (0.0-1.0).
anumber|nilAlpha component (0.0-1.0), defaults to 1.0.

Returns: PMUI.ProgressBar

PMUI.ProgressBar:SetShowText(show, customText) ​

Controls whether progress text is displayed. An optional custom string can be used instead of the automatically calculated percentage.

ParameterTypeDescription
showbooleanWhether to display text.
customTextstring|nilCustom text to display instead of the percentage.

Returns: PMUI.ProgressBar

PMUI.ProgressBar:prerender() ​

Renders the progress bar, including its background, fill, border, and optional text. The fill width is calculated from the current animated display value.