Table of Contents

Class RichTextComponent

Namespace
Vintagestory.API.Client
Assembly
VintagestoryAPI.dll
public class RichTextComponent : RichTextComponentBase
Inheritance
RichTextComponent
Derived
Inherited Members
Extension Methods

Constructors

RichTextComponent(ICoreClientAPI, string, CairoFont)

public RichTextComponent(ICoreClientAPI api, string displayText, CairoFont font)

Parameters

api ICoreClientAPI
displayText string
font CairoFont

Fields

DisplayText

public string DisplayText

Field Value

string

Font

public CairoFont Font

Field Value

CairoFont

Lines

public TextLine[] Lines

Field Value

TextLine[]

linebreak

protected EnumLinebreakBehavior linebreak

Field Value

EnumLinebreakBehavior

textUtil

protected TextDrawUtil textUtil

Field Value

TextDrawUtil

Methods

CalcBounds(TextFlowPath[], double, double, double, out double)

Initializes the size and stuff. Return true if you had to enter the next line

public override EnumCalcBoundsResult CalcBounds(TextFlowPath[] flowPath, double currentLineHeight, double offsetX, double lineY, out double nextOffsetX)

Parameters

flowPath TextFlowPath[]
currentLineHeight double
offsetX double
lineY double
nextOffsetX double

Returns

EnumCalcBoundsResult

True when longer than 1 line

ComposeElements(Context, ImageSurface)

Composes the element.

public override void ComposeElements(Context ctx, ImageSurface surface)

Parameters

ctx Context

Context of the text component.

surface ImageSurface

The surface of the image.

GetFontOrientOffsetX()

protected double GetFontOrientOffsetX()

Returns

double

RenderInteractiveElements(float, double, double, double)

Renders the text component.

public override void RenderInteractiveElements(float deltaTime, double renderX, double renderY, double renderZ)

Parameters

deltaTime float
renderX double
renderY double
renderZ double

init()

protected void init()