Table of Contents

Class LinkTextComponent

Namespace
Vintagestory.API.Client
Assembly
VintagestoryAPI.dll
public class LinkTextComponent : RichTextComponent
Inheritance
LinkTextComponent
Inherited Members

Constructors

LinkTextComponent(ICoreClientAPI, string, CairoFont, Action<LinkTextComponent>)

A text component with an embedded link.

public LinkTextComponent(ICoreClientAPI api, string displayText, CairoFont font, Action<LinkTextComponent> onLinkClicked)

Parameters

api ICoreClientAPI
displayText string

The text of the Text.

font CairoFont
onLinkClicked Action<LinkTextComponent>

Fields

Href

public string Href

Field Value

string

Properties

Clickable

public bool Clickable { get; set; }

Property Value

bool

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 ctxStatic, ImageSurface surfaceStatic)

Parameters

ctxStatic Context
surfaceStatic ImageSurface

Dispose()

public override void Dispose()
public void HandleLink()

OnMouseDown(MouseEvent)

public override void OnMouseDown(MouseEvent args)

Parameters

args MouseEvent

OnMouseUp(MouseEvent)

public override void OnMouseUp(MouseEvent args)

Parameters

args MouseEvent

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

SetHref(string)

public LinkTextComponent SetHref(string href)

Parameters

href string

Returns

LinkTextComponent

Trigger()

public void Trigger()

UseMouseOverCursor(ElementBounds)

public override bool UseMouseOverCursor(ElementBounds richtextBounds)

Parameters

richtextBounds ElementBounds

Returns

bool