Class GuiElementStatbar
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
A stat bar to the GUI for keeping track of progress and numbers.
public class GuiElementStatbar : GuiElementTextBase, IDisposable
- Inheritance
-
GuiElementStatbar
- Implements
- Inherited Members
- Extension Methods
Constructors
GuiElementStatbar(ICoreClientAPI, ElementBounds, double[], bool, bool)
Creates a new stat bar for the GUI.
public GuiElementStatbar(ICoreClientAPI capi, ElementBounds bounds, double[] color, bool rightToLeft, bool hideable)
Parameters
capi
ICoreClientAPIThe client API
bounds
ElementBoundsThe bounds of the stat bar.
color
double[]The color of the stat bar.
rightToLeft
boolDetermines the direction that the bar fills.
hideable
bool
Fields
DefaultHeight
public static double DefaultHeight
Field Value
FlashTime
public float FlashTime
Field Value
ShouldFlash
public bool ShouldFlash
Field Value
ShowValueOnHover
public bool ShowValueOnHover
Field Value
onGetStatbarValue
public StatbarValueDelegate onGetStatbarValue
Field Value
valueFont
public CairoFont valueFont
Field Value
Properties
HideWhenFull
public bool HideWhenFull { get; set; }
Property Value
Methods
ComposeElements(Context, ImageSurface)
Composes the elements.
public override void ComposeElements(Context ctx, ImageSurface surface)
Parameters
ctx
Contextsurface
ImageSurfaceThe surface of the GUI.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public override void Dispose()
GetValue()
public float GetValue()
Returns
RenderInteractiveElements(float)
Renders the element as an interactive element.
public override void RenderInteractiveElements(float deltaTime)
Parameters
deltaTime
floatThe change in time.
SetLineInterval(float)
Sets the line interval for the Status Bar.
public void SetLineInterval(float value)
Parameters
value
floatThe value to set for the line interval/
SetMinMax(float, float)
Sets the minimum and maximum values of the status bar.
public void SetMinMax(float min, float max)
Parameters
SetValue(float)
Sets the value for the status bar and updates the bar.
public void SetValue(float value)
Parameters
value
floatThe new value of the status bar.
SetValues(float, float, float)
Sets the value for the status bar as well as the minimum and maximum values.
public void SetValues(float value, float min, float max)