Table of Contents

Class RichTextComponentBase

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

Constructors

RichTextComponentBase(ICoreClientAPI)

public RichTextComponentBase(ICoreClientAPI api)

Parameters

api ICoreClientAPI

Fields

api

protected ICoreClientAPI api

Field Value

ICoreClientAPI

Properties

BoundsPerLine

The width/height boundaries of this text component per line

public virtual LineRectangled[] BoundsPerLine { get; protected set; }

Property Value

LineRectangled[]

Float

When left or right, then this element can span over multiple text lines

public virtual EnumFloat Float { get; set; }

Property Value

EnumFloat

MouseOverCursor

public string MouseOverCursor { get; protected set; }

Property Value

string

PaddingLeft

Unscaled value

public virtual double PaddingLeft { get; set; }

Property Value

double

PaddingRight

Padding that is used when a richtextcomponent came before and needs some left spacing to it. Unscaled value

public virtual double PaddingRight { get; set; }

Property Value

double

RenderColor

public virtual Vec4f RenderColor { get; set; }

Property Value

Vec4f

UnscaledMarginTop

This will be the Y-Advance into the next line. Unscaled value. Also used as the offset with EnumVerticalAlign.FixedOffset

public virtual double UnscaledMarginTop { get; set; }

Property Value

double

VerticalAlign

public virtual EnumVerticalAlign VerticalAlign { get; set; }

Property Value

EnumVerticalAlign

Methods

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

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

public virtual 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

A

ComposeElements(Context, ImageSurface)

Composes the element.

public virtual void ComposeElements(Context ctx, ImageSurface surface)

Parameters

ctx Context
surface ImageSurface

Dispose()

public virtual void Dispose()

GetCurrentFlowPathSection(TextFlowPath[], double)

protected virtual TextFlowPath GetCurrentFlowPathSection(TextFlowPath[] flowPath, double posY)

Parameters

flowPath TextFlowPath[]
posY double

Returns

TextFlowPath

OnMouseDown(MouseEvent)

public virtual void OnMouseDown(MouseEvent args)

Parameters

args MouseEvent

OnMouseMove(MouseEvent)

public virtual void OnMouseMove(MouseEvent args)

Parameters

args MouseEvent

OnMouseUp(MouseEvent)

public virtual void OnMouseUp(MouseEvent args)

Parameters

args MouseEvent

RenderInteractiveElements(float, double, double, double)

Renders the text component.

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

Parameters

deltaTime float
renderX double
renderY double
renderZ double

UseMouseOverCursor(ElementBounds)

public virtual bool UseMouseOverCursor(ElementBounds richtextBounds)

Parameters

richtextBounds ElementBounds

Returns

bool