Class LinkTextComponent
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
public class LinkTextComponent : RichTextComponent
- Inheritance
-
LinkTextComponent
- Inherited Members
- Extension Methods
Constructors
LinkTextComponent(string)
Create a dummy link text component for use with triggering link protocols through code. Not usable for anything gui related (it'll crash if you try)
public LinkTextComponent(string href)
Parameters
href
string
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
ICoreClientAPIdisplayText
stringThe text of the Text.
font
CairoFontonLinkClicked
Action<LinkTextComponent>
Fields
Href
public string Href
Field Value
Properties
Clickable
public bool Clickable { get; set; }
Property Value
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
doubleoffsetX
doublelineY
doublenextOffsetX
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
ContextsurfaceStatic
ImageSurface
Dispose()
public override void Dispose()
HandleLink()
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
SetHref(string)
public LinkTextComponent SetHref(string href)
Parameters
href
string
Returns
Trigger()
public void Trigger()
UseMouseOverCursor(ElementBounds)
public override bool UseMouseOverCursor(ElementBounds richtextBounds)
Parameters
richtextBounds
ElementBounds