Class GuiElementStatbar
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
A stat bar to the GUI for keeping track of progress and numbers. Open in GitHub
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
capiICoreClientAPIThe client API
boundsElementBoundsThe bounds of the stat bar.
colordouble[]The color of the stat bar.
rightToLeftboolDetermines the direction that the bar fills.
hideablebool
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
PrevValueBeingDisplayed
public bool PrevValueBeingDisplayed { get; }
Property Value
PreviousValueDisplayTime
public float PreviousValueDisplayTime { get; set; }
Property Value
Methods
ComposeElements(Context, ImageSurface)
Composes the elements.
public override void ComposeElements(Context ctx, ImageSurface surface)
Parameters
ctxContextsurfaceImageSurfaceThe 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
deltaTimefloatThe change in time.
SetFutureValues(float?, float)
public void SetFutureValues(float? futureValue, float velocity)
Parameters
SetLineInterval(float)
Sets the line interval for the Status Bar.
public void SetLineInterval(float value)
Parameters
valuefloatThe 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
SetPrevValue(float?, long, Func<long>)
public void SetPrevValue(float? previousValue, long visibleSinceMs, Func<long> getMs)
Parameters
SetValue(float)
Sets the value for the status bar and updates the bar.
public void SetValue(float value)
Parameters
valuefloatThe 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)