Table of Contents

Class ProgressBar

Namespace
UILib.Components
Assembly
UILib.dll

A simple progress bar. Provides a simple visual representation of progress.

public class ProgressBar : UIComponent
Inheritance
ProgressBar
Inherited Members

Constructors

ProgressBar(bool)

Initializes the progress bar.

public ProgressBar(bool vertical = false)

Parameters

vertical bool

Whether this progress bar should be vertical

Properties

background

The background for this progress bar.

public Image background { get; }

Property Value

Image

fill

The fill for this progress bar.

public Image fill { get; }

Property Value

Image

progress

The current amount of progress (between 0 and 1).

public float progress { get; }

Property Value

float

vertical

Whether this progress bar is vertical.

public bool vertical { get; }

Property Value

bool

Methods

SetProgress(float)

Sets the progress of this progress bar. This must be between 0 and 1.

public void SetProgress(float progress)

Parameters

progress float

The value to set the progress to

SetThisTheme(Theme)

Allows setting the theme of this progress bar.

This handles setting the theme specifically for this component, not its children. It's protected to allow overriding if you were to create a subclass.

In most cases, you'd probably want to use SetTheme(Theme) instead.

protected override void SetThisTheme(Theme theme)

Parameters

theme Theme

The theme to apply

SetVertical(bool)

Sets whether this progress bar is vertical.

Passing true means it will become vertical (bottom to top). Passing false means it will become horizontal (left to right).

This will also immediately update the progress bar's visuals.

public void SetVertical(bool vertical)

Parameters

vertical bool

Whether this progress bar is vertical