Class GuiElementDynamicText
- Namespace
 - Vintagestory.API.Client
 
- Assembly
 - VintagestoryAPI.dll
 
Text that can be changed after being composed Open in GitHub
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
capiICoreClientAPIThe client API.
textstringThe starting text on the component.
fontCairoFontThe font of the text.
boundsElementBoundsthe 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
ctxContextsurfaceImageSurface
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
apiICoreClientAPIThe Client API
argsMouseEventThe mouse event args.
RecomposeText(bool)
Recomposes the element for lines.
public void RecomposeText(bool async = false)
  Parameters
asyncbool
RenderInteractiveElements(float)
Renders the element as an interactive element.
public override void RenderInteractiveElements(float deltaTime)
  Parameters
deltaTimefloatThe 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
textstringThe text of the component.
autoHeightboolWhether the height of the component should be modified.
forceRedrawboolWhether the element should be redrawn.
asyncbool
SetNewTextAsync(string, bool, bool)
public void SetNewTextAsync(string text, bool autoHeight = false, bool forceRedraw = false)