Table of Contents

Class ProgressBar

Namespace
BSGameLib.UI.Controls
Assembly
BSGameLib.UI.dll

A horizontal bar filled in proportion to Value.

public class ProgressBar : UIElement, IUpdateable, IEquatable<IUpdateable>, IDrawable, IIdentifiable<Guid>, IEquatable<IDrawable>, IDisposable
Inheritance
ProgressBar
Implements
Inherited Members

Remarks

Deliberately not an InteractiveControl - it reports, it isn't a slider. Drawn from shapes rather than a texture, like the rest of the art-free theming: a track rect, a fill rect over the left portion of it, and an optional border over both.

Constructors

ProgressBar(ILogger, View, string)

Creates a progress bar in view.

public ProgressBar(ILogger logger, View view, string id = null)

Parameters

logger ILogger
view View
id string

Properties

Fraction

0 when Maximum is 0, so an unknown total reads as empty rather than full.

public float Fraction { get; }

Property Value

float

Maximum

The value that fills the bar completely.

public float Maximum { get; set; }

Property Value

float

TrackColor

The unfilled track behind the bar.

public Color? TrackColor { get; set; }

Property Value

Color?

Remarks

The filled portion uses the inherited FillColor / FillGradient, so "fill" means the same thing here as on every other control; the track is the extra concept, and the only one needing its own name.

Value

How far along the bar is, clamped into 0..Maximum.

public float Value { get; set; }

Property Value

float

Methods

Draw(IGameTime)

Draws the track, the filled part and the border.

public override void Draw(IGameTime gameTime)

Parameters

gameTime IGameTime