Skip to content

ProgressBar ​

Путь подключения: require "ProjectMotionUI/Components/ProgressBar"


Класс PMUI.ProgressBar ​

Наследуется от: PMUI.BaseElement

Методы и функции ​

PMUI.ProgressBar:new(minVal, maxVal) ​

Creates a progress bar with the specified value range.

ПараметрТипОписание
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.

ПараметрТипОписание
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.

ПараметрТипОписание
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.

ПараметрТипОписание
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.

ПараметрТипОписание
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.