Table of Contents

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

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 ICoreClientAPI

The client API.

text string

The starting text on the component.

font CairoFont

The font of the text.

bounds ElementBounds

the bounds of the text.

Fields

OnClick

public Action OnClick

Field Value

Action

autoHeight

public bool autoHeight

Field Value

bool

Properties

QuantityTextLines

public int QuantityTextLines { get; }

Property Value

int

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 Context
surface 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 ICoreClientAPI

The Client API

args MouseEvent

The 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 float

The 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 string

The text of the component.

autoHeight bool

Whether the height of the component should be modified.

forceRedraw bool

Whether the element should be redrawn.

async bool

SetNewTextAsync(string, bool, bool)

public void SetNewTextAsync(string text, bool autoHeight = false, bool forceRedraw = false)

Parameters

text string
autoHeight bool
forceRedraw bool