Class GuiElementNumberInput
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
A numerical input field for inputting numbers. Open in GitHub
public class GuiElementNumberInput : GuiElementTextInput, IDisposable
- Inheritance
-
GuiElementNumberInput
- Implements
- Inherited Members
- Extension Methods
Constructors
GuiElementNumberInput(ICoreClientAPI, ElementBounds, Action<string>, CairoFont)
Creates a numerical input field.
public GuiElementNumberInput(ICoreClientAPI capi, ElementBounds bounds, Action<string> OnTextChanged, CairoFont font)
Parameters
capiICoreClientAPIThe Client API
boundsElementBoundsThe bounds of the GUI.
OnTextChangedAction<string>The event fired when the number is changed.
fontCairoFontThe font of the numbers.
Fields
DisableButtonFocus
When enabled and a button is clicked it wont focus on it, leaving your focus on the game to move around
public bool DisableButtonFocus
Field Value
Interval
public float Interval
Field Value
buttonHighlightTexture
public LoadedTexture buttonHighlightTexture
Field Value
Properties
Focusable
Whether or not the element can be focused.
public override bool Focusable { get; }
Property Value
IntMode
public bool IntMode { get; set; }
Property Value
Methods
ComposeTextElements(Context, ImageSurface)
public override void ComposeTextElements(Context ctx, ImageSurface surface)
Parameters
ctxContextsurfaceImageSurface
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.
LoadValue(List<string>)
Sets given texts, leaves cursor position unchanged unless it's now invalid
public override void LoadValue(List<string> newLines)
Parameters
OnFocusLost()
The event fired when the element looses focus.
public override void OnFocusLost()
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
apiICoreClientAPIThe Client API
argsMouseEventThe mouse event args.
OnMouseWheel(ICoreClientAPI, MouseWheelEventArgs)
The event fired when the mouse wheel is scrolled.
public override void OnMouseWheel(ICoreClientAPI api, MouseWheelEventArgs args)
Parameters
apiICoreClientAPIThe Client API
argsMouseWheelEventArgsThe mouse wheel arguments.
RenderInteractiveElements(float)
Renders the element as an interactive element.
public override void RenderInteractiveElements(float deltaTime)
Parameters
deltaTimefloatThe change in time.