Skip to main content
Version: v2.4.0 (Current)

📊 Bar

The Bar widget is a linear visual indicator used to represent progress, volume, or any numeric scale. Unlike the Slider, the Bar is primarily used for output display rather than user input.


⚙️ Properties (Props)

The Bar behavior is defined by the BarWidget interface. It supports advanced filling modes to accommodate various types of data visualization.

PropertyTypeDescription
ValuenumberThe current end position of the indicator.
Value StartnumberThe starting position (only used in Range mode).
RangenumberThe Min and Max limits (e.g., 0 to 100).
ModeDropdownDetermines how the bar fills (Normal, Symmetrical, or Range).

🛠 Operation Modes

The Bar widget adapts its visual logic based on the mode property:

  • Normal: The indicator grows from the rangeMin value toward the current value.
  • Symmetrical: The indicator grows from a zero point. This is ideal for values that can be both positive and negative (e.g., -50 to +50).
  • Range: The indicator is drawn specifically between valueStart and value. This is useful for representing a specific "active zone" or buffer.

🎨 Visual Styling

A Bar consists of two main style layers in the Inspector Panel:

  1. Main (Background): The container representing the full potential range.
  2. Indicator (Foreground): The part of the bar that fills up based on the data.

⚡ Runtime API (Lua)

The Bar is frequently updated via system variables or communication protocols.

-- Update a standard progress bar
bar_progress:set_value(75)

-- In Range mode, set both the start and end points
bar_buffer:set_value_start(10)
bar_buffer:set_value(45)

-- Adjust color based on critical levels
if bar_battery:get_value() < 20 then
bar_battery:set_style_bg_color(0xFF0000) -- Red for low battery
end

PERFORMANCE

Bars are extremely lightweight on memory. For simple status indicators (like signal strength or battery), the Bar widget is more efficient than using multiple static images.


🚀 Next Steps

  • Arc — Use this for a circular version of the progress bar.
  • Meter — For gauges that require tick marks and numerical scales.
  • Chart — Use this if you need to show a history of values over time.