1.3 KiB
1.3 KiB
ProgressBar
This is the progress bar class. It provides a visual representation of progress with optional percentage display and customizable colors.
Extends: VisualElement
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| progress | number | 0 | Current progress value (0-100) |
| showPercentage | boolean | false | Whether to show the percentage text in the center |
| progressColor | color | lime | The color used for the filled portion of the progress bar |
| direction | string | right | The direction of the progress bar ("up", "down", "left", "right") |
Functions
| Method | Returns | Description |
|---|---|---|
| ProgressBar.new | ProgressBar | Creates a new ProgressBar instance |
| ProgressBar:init | ProgressBar | Initializes the ProgressBar instance |
| ProgressBar:render | - | Renders the progress bar with filled portion and optional percentage text |
ProgressBar.new()
Creates a new ProgressBar instance
Returns
ProgressBarselfThe newly created ProgressBar instance
ProgressBar:init(props, basalt)
Parameters
propstableThe properties to initialize the element withbasalttableThe basalt instance
Returns
ProgressBarselfThe initialized instance