Skip to content

ProgressBarAttribute

Namespace: SideXP.Core | Inherits from: PropertyAttribute

public class ProgressBarAttribute : PropertyAttribute

Draws a progress bar next to a numeric field in the inspector.

Constructors

ProgressBarAttribute(FColor)

public ProgressBarAttribute(FColor color = Aqua | Alpha100)

Draws a progress bar from 0 to 100 next to a numeric field in the inspector.

Parameters

  • color

ProgressBarAttribute(float, FColor)

public ProgressBarAttribute(float max, FColor color = Aqua | Alpha100)

Draws a progress bar from 0 to max next to a numeric field in the inspector.

Parameters

  • max
  • color

ProgressBarAttribute(float, float, FColor)

public ProgressBarAttribute(float min, float max, FColor color = Aqua | Alpha100)

Draws a progress bar from min to max next to a numeric field in the inspector.

Parameters

  • min
  • max
  • color

Fields

DefaultColor

public const FColor DefaultColor = Aqua | Alpha100

Properties

Min

public float Min

The minimum value of the progress bar.

Max

public float Max

The maximum value of the progress bar.

Color

public Color Color

The color of the progress bar.

Prefix

public string Prefix

The prefix to write before the value on the progress bar.

Suffix

public string Suffix

The suffix to write after the value on the progress bar.

Clamp

public bool Clamp

If enabled, the field's value will be clamped between min and max.

Wide

public bool Wide

If enabled, the field is completely hidden by the progress bar.

Readonly

public bool Readonly

Should the field be readonly?

Methods

GetLabel(float)

public string GetLabel(float value)

Gets the label of the progress bar, using the defined prefix and suffix.

Parameters

  • value: The current value of the field.

Returns

Returns the computed label.