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
hrefstring
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
apiICoreClientAPIdisplayTextstringThe text of the Text.
fontCairoFontonLinkClickedAction<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
flowPathTextFlowPath[]currentLineHeightdoubleoffsetXdoublelineYdoublenextOffsetXdouble
Returns
- EnumCalcBoundsResult
True when longer than 1 line
ComposeElements(Context, ImageSurface)
Composes the element.
public override void ComposeElements(Context ctxStatic, ImageSurface surfaceStatic)
Parameters
ctxStaticContextsurfaceStaticImageSurface
Dispose()
public override void Dispose()
HandleLink()
public void HandleLink()
OnMouseDown(MouseEvent)
public override void OnMouseDown(MouseEvent args)
Parameters
argsMouseEvent
OnMouseUp(MouseEvent)
public override void OnMouseUp(MouseEvent args)
Parameters
argsMouseEvent
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
hrefstring
Returns
Trigger()
public void Trigger()
UseMouseOverCursor(ElementBounds)
public override bool UseMouseOverCursor(ElementBounds richtextBounds)
Parameters
richtextBoundsElementBounds