Class GuiElementNumberInput
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
A numerical input field for inputting numbers.
public class GuiElementNumberInput : GuiElementTextInput, IDisposable
- Inheritance
-
GuiElementNumberInput
- Implements
- Inherited Members
Constructors
GuiElementNumberInput(ICoreClientAPI, ElementBounds, Action<string>, CairoFont)
Creates a numerical input field.
public GuiElementNumberInput(ICoreClientAPI capi, ElementBounds bounds, Action<string> OnTextChanged, CairoFont font)
Parameters
capi
ICoreClientAPIThe Client API
bounds
ElementBoundsThe bounds of the GUI.
OnTextChanged
Action<string>The event fired when the number is changed.
font
CairoFontThe font of the numbers.
Fields
Interval
public float Interval
Field Value
buttonHighlightTexture
public LoadedTexture buttonHighlightTexture
Field Value
Methods
ComposeTextElements(Context, ImageSurface)
public override void ComposeTextElements(Context ctx, ImageSurface surface)
Parameters
ctx
Contextsurface
ImageSurface
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public override void Dispose()
GetValue()
Gets the current value of the number.
public float GetValue()
Returns
- float
A float representing the value.
OnMouseDownOnElement(ICoreClientAPI, MouseEvent)
The event fired when the mouse is pressed while on the element. Called after OnMouseDown and tells the engine that the event is handled.
public override void OnMouseDownOnElement(ICoreClientAPI api, MouseEvent args)
Parameters
api
ICoreClientAPIThe Client API
args
MouseEventThe mouse event args.
OnMouseWheel(ICoreClientAPI, MouseWheelEventArgs)
The event fired when the mouse wheel is scrolled.
public override void OnMouseWheel(ICoreClientAPI api, MouseWheelEventArgs args)
Parameters
api
ICoreClientAPIThe Client API
args
MouseWheelEventArgsThe mouse wheel arguments.
RenderInteractiveElements(float)
Renders the element as an interactive element.
public override void RenderInteractiveElements(float deltaTime)
Parameters
deltaTime
floatThe change in time.