Table of Contents

Class GuiElementRichtext

Namespace
Vintagestory.API.Client
Assembly
VintagestoryAPI.dll
public class GuiElementRichtext : GuiElement, IDisposable
Inheritance
GuiElementRichtext
Implements
Inherited Members

Constructors

GuiElementRichtext(ICoreClientAPI, RichTextComponentBase[], ElementBounds)

public GuiElementRichtext(ICoreClientAPI capi, RichTextComponentBase[] components, ElementBounds bounds)

Parameters

capi ICoreClientAPI
components RichTextComponentBase[]
bounds ElementBounds

Fields

Components

public RichTextComponentBase[] Components

Field Value

RichTextComponentBase[]

Debug

public bool Debug

Field Value

bool

DebugLogging

public static bool DebugLogging

Field Value

bool

HalfComposed

public bool HalfComposed

Field Value

bool

RenderColor

public Vec4f RenderColor

Field Value

Vec4f

flowPath

protected TextFlowPath[] flowPath

Field Value

TextFlowPath[]

richtTextTexture

public LoadedTexture richtTextTexture

Field Value

LoadedTexture

zPos

public float zPos

Field Value

float

Properties

MaxLineWidth

public double MaxLineWidth { get; }

Property Value

double

TotalHeight

public double TotalHeight { get; }

Property Value

double

Methods

AppendText(RichTextComponent[])

public void AppendText(RichTextComponent[] comps)

Parameters

comps RichTextComponent[]

BeforeCalcBounds()

public override void BeforeCalcBounds()

CalcHeightAndPositions()

public void CalcHeightAndPositions()

Compose(bool)

public void Compose(bool genTextureLater = false)

Parameters

genTextureLater bool

ComposeElements(Context, ImageSurface)

Composes the elements.

public override void ComposeElements(Context ctxStatic, ImageSurface surfaceStatic)

Parameters

ctxStatic Context

The context of the components.

surfaceStatic ImageSurface

ComposeFor(ElementBounds, Context, ImageSurface)

public virtual void ComposeFor(ElementBounds bounds, Context ctx, ImageSurface surface)

Parameters

bounds ElementBounds
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.

OnMouseMove(ICoreClientAPI, MouseEvent)

The event fired when the mouse is moved.

public override void OnMouseMove(ICoreClientAPI api, MouseEvent args)

Parameters

api ICoreClientAPI

The Client API.

args MouseEvent

The mouse event arguments.

OnMouseUp(ICoreClientAPI, MouseEvent)

The event fired when the mouse is released.

public override void OnMouseUp(ICoreClientAPI api, MouseEvent args)

Parameters

api ICoreClientAPI

The Client API.

args MouseEvent

The arguments for the mouse event.

RecomposeInto(ImageSurface, Context)

public void RecomposeInto(ImageSurface surface, Context ctx)

Parameters

surface ImageSurface
ctx Context

RecomposeText()

Recomposes the element for lines.

public void RecomposeText()

RenderInteractiveElements(float)

Renders the element as an interactive element.

public override void RenderInteractiveElements(float deltaTime)

Parameters

deltaTime float

The change in time.

SetNewText(string, CairoFont, Action<LinkTextComponent>)

public void SetNewText(string vtmlCode, CairoFont baseFont, Action<LinkTextComponent> didClickLink = null)

Parameters

vtmlCode string
baseFont CairoFont
didClickLink Action<LinkTextComponent>

SetNewText(RichTextComponentBase[])

public void SetNewText(RichTextComponentBase[] comps)

Parameters

comps RichTextComponentBase[]

SetNewTextWithoutRecompose(string, CairoFont, Action<LinkTextComponent>, bool)

public void SetNewTextWithoutRecompose(string vtmlCode, CairoFont baseFont, Action<LinkTextComponent> didClickLink = null, bool recalcBounds = false)

Parameters

vtmlCode string
baseFont CairoFont
didClickLink Action<LinkTextComponent>
recalcBounds bool

genTexture()

public void genTexture()