Class GuiElementTextInput
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
public class GuiElementTextInput : GuiElementEditableTextBase, IDisposable
- Inheritance
-
GuiElementTextInput
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
GuiElementTextInput(ICoreClientAPI, ElementBounds, Action<string>, CairoFont)
Adds a text input to the GUI
public GuiElementTextInput(ICoreClientAPI capi, ElementBounds bounds, Action<string> onTextChanged, CairoFont font)
Parameters
capiICoreClientAPIThe Client API
boundsElementBoundsThe bounds of the text input.
onTextChangedAction<string>The event fired when the text is changed.
fontCairoFontThe font of the text.
Fields
highlightBounds
protected ElementBounds highlightBounds
Field Value
highlightTexture
protected LoadedTexture highlightTexture
Field Value
refocusStage
protected int refocusStage
Field Value
Properties
Enabled
Enables/disables the given element (default is enabled)
public override bool Enabled { 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()
HideCharacters()
Tells the text component to hide the characters in the text.
public void HideCharacters()
OnFocusGained()
The event fired when the element gains focus.
public override void OnFocusGained()
OnFocusLost()
The event fired when the element looses focus.
public override void OnFocusLost()
OnKeyDown(ICoreClientAPI, KeyEvent)
The event fired when a key is held down.
public override void OnKeyDown(ICoreClientAPI api, KeyEvent args)
Parameters
apiICoreClientAPIThe client API
argsKeyEventThe key event arguments.
RenderInteractiveElements(float)
Renders the element as an interactive element.
public override void RenderInteractiveElements(float deltaTime)
Parameters
deltaTimefloatThe change in time.
SetPlaceHolderText(string)
public void SetPlaceHolderText(string text)
Parameters
textstring