Table of Contents

Class ProgressBar

Namespace
MagicUI.Elements
Assembly
MagicUI.dll

A horizontal progress bar. Note that this element only manages the filling image and value, for a more visually complex progress bar (e.g. with a border), use a Panel (recommended) or GridLayout to overlay the progress bar on a border image.

public sealed class ProgressBar : ArrangableElement, IGameObjectWrapper
Inheritance
ProgressBar
Implements
Inherited Members
Extension Methods

Constructors

ProgressBar(LayoutRoot, Sprite, string)

Creates a progress bar

public ProgressBar(LayoutRoot onLayout, Sprite sprite, string name = "New ProgressBar")

Parameters

onLayout LayoutRoot

The layout root to draw the progress bar on

sprite Sprite

The sprite to use to render the progress bar

name string

The name of the progress bar element

Properties

GameObject

The UnityEngine.GameObject underlying this UI element

public GameObject GameObject { get; }

Property Value

GameObject

Height

The desired height of the progress bar; it will be scaled as needed

public float Height { get; set; }

Property Value

float

Sprite

The current sprite underlying the progress bar

public Sprite Sprite { get; set; }

Property Value

Sprite

Tint

A color to apply over top of the progress bar's image

public Color Tint { get; set; }

Property Value

Color

Value

The value of the progress bar, as a percentage

public float Value { get; set; }

Property Value

float

Width

The desired width of the progress bar; it will be scaled as needed

public float Width { get; set; }

Property Value

float

Methods

ArrangeOverride(Vector2)

Internal implementation to position the object within the allocated space.

protected override void ArrangeOverride(Vector2 alignedTopLeftCorner)

Parameters

alignedTopLeftCorner Vector2

The space available for the element.

DestroyOverride()

Internal implementation to perform any additional cleanup when the element is destroyed

protected override void DestroyOverride()

MeasureOverride()

Internal implementation to calculate desired size.

protected override Vector2 MeasureOverride()

Returns

Vector2