Table of Contents

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 ICoreClientAPI

The client API

bounds ElementBounds

The bounds of the stat bar.

color double[]

The color of the stat bar.

rightToLeft bool

Determines the direction that the bar fills.

hideable bool

Fields

DefaultHeight

public static double DefaultHeight

Field Value

double

FlashTime

public float FlashTime

Field Value

float

ShouldFlash

public bool ShouldFlash

Field Value

bool

ShowValueOnHover

public bool ShowValueOnHover

Field Value

bool

onGetStatbarValue

public StatbarValueDelegate onGetStatbarValue

Field Value

StatbarValueDelegate

valueFont

public CairoFont valueFont

Field Value

CairoFont

Properties

HideWhenFull

public bool HideWhenFull { get; set; }

Property Value

bool

Methods

ComposeElements(Context, ImageSurface)

Composes the elements.

public override void ComposeElements(Context ctx, ImageSurface surface)

Parameters

ctx Context
surface ImageSurface

The 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

float

RenderInteractiveElements(float)

Renders the element as an interactive element.

public override void RenderInteractiveElements(float deltaTime)

Parameters

deltaTime float

The change in time.

SetLineInterval(float)

Sets the line interval for the Status Bar.

public void SetLineInterval(float value)

Parameters

value float

The 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

min float

The minimum value of the status bar.

max float

The maximum value of the status bar.

SetValue(float)

Sets the value for the status bar and updates the bar.

public void SetValue(float value)

Parameters

value float

The 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)

Parameters

value float

The new value of the status bar.

min float

The minimum value of the status bar.

max float

The maximum value of the status bar.