Class GuiElementDynamicText
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
Text that can be changed after being composed
public class GuiElementDynamicText : GuiElementTextBase, IDisposable
- Inheritance
-
GuiElementDynamicText
- Implements
- Inherited Members
- Extension Methods
Constructors
GuiElementDynamicText(ICoreClientAPI, string, CairoFont, ElementBounds)
Adds a new element that renders text dynamically.
public GuiElementDynamicText(ICoreClientAPI capi, string text, CairoFont font, ElementBounds bounds)
Parameters
capi
ICoreClientAPIThe client API.
text
stringThe starting text on the component.
font
CairoFontThe font of the text.
bounds
ElementBoundsthe bounds of the text.
Fields
OnClick
public Action OnClick
Field Value
autoHeight
public bool autoHeight
Field Value
Properties
QuantityTextLines
public int QuantityTextLines { get; }
Property Value
Methods
AutoHeight()
Automatically adjusts the height of the dynamic text.
public void AutoHeight()
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()
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.
RecomposeText(bool)
Recomposes the element for lines.
public void RecomposeText(bool async = false)
Parameters
async
bool
RenderInteractiveElements(float)
Renders the element as an interactive element.
public override void RenderInteractiveElements(float deltaTime)
Parameters
deltaTime
floatThe change in time.
SetNewText(string, bool, bool, bool)
Sets the text value of the element.
public void SetNewText(string text, bool autoHeight = false, bool forceRedraw = false, bool async = false)
Parameters
text
stringThe text of the component.
autoHeight
boolWhether the height of the component should be modified.
forceRedraw
boolWhether the element should be redrawn.
async
bool
SetNewTextAsync(string, bool, bool)
public void SetNewTextAsync(string text, bool autoHeight = false, bool forceRedraw = false)