Class GuiElementRichtext
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
public class GuiElementRichtext : GuiElement, IDisposable
- Inheritance
-
GuiElementRichtext
- Implements
- Inherited Members
- Extension Methods
Constructors
GuiElementRichtext(ICoreClientAPI, RichTextComponentBase[], ElementBounds)
public GuiElementRichtext(ICoreClientAPI capi, RichTextComponentBase[] components, ElementBounds bounds)
Parameters
capi
ICoreClientAPIcomponents
RichTextComponentBase[]bounds
ElementBounds
Fields
Components
public RichTextComponentBase[] Components
Field Value
Debug
public bool Debug
Field Value
DebugLogging
public static bool DebugLogging
Field Value
HalfComposed
public bool HalfComposed
Field Value
RenderColor
public Vec4f RenderColor
Field Value
flowPath
protected TextFlowPath[] flowPath
Field Value
richtTextTexture
public LoadedTexture richtTextTexture
Field Value
zPos
public float zPos
Field Value
Properties
MaxHeight
public int MaxHeight { get; set; }
Property Value
MaxLineWidth
public double MaxLineWidth { get; }
Property Value
TotalHeight
public double TotalHeight { get; }
Property Value
Methods
AppendText(RichTextComponent[])
public void AppendText(RichTextComponent[] comps)
Parameters
comps
RichTextComponent[]
BeforeCalcBounds()
public override void BeforeCalcBounds()
CalcHeightAndPositions()
public void CalcHeightAndPositions()
Compose(bool)
public void Compose(bool genTextureLater = false)
Parameters
genTextureLater
bool
ComposeElements(Context, ImageSurface)
Composes the elements.
public override void ComposeElements(Context ctxStatic, ImageSurface surfaceStatic)
Parameters
ctxStatic
ContextThe context of the components.
surfaceStatic
ImageSurface
ComposeFor(ElementBounds, Context, ImageSurface)
public virtual void ComposeFor(ElementBounds bounds, Context ctx, ImageSurface surface)
Parameters
bounds
ElementBoundsctx
Contextsurface
ImageSurface
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public override void Dispose()
OnMouseDownOnElement(ICoreClientAPI, MouseEvent)
The event fired when the mouse is pressed while on the element. Called after OnMouseDown and tells the engine that the event is handled.
public override void OnMouseDownOnElement(ICoreClientAPI api, MouseEvent args)
Parameters
api
ICoreClientAPIThe Client API
args
MouseEventThe mouse event args.
OnMouseMove(ICoreClientAPI, MouseEvent)
The event fired when the mouse is moved.
public override void OnMouseMove(ICoreClientAPI api, MouseEvent args)
Parameters
api
ICoreClientAPIThe Client API.
args
MouseEventThe mouse event arguments.
OnMouseUp(ICoreClientAPI, MouseEvent)
The event fired when the mouse is released.
public override void OnMouseUp(ICoreClientAPI api, MouseEvent args)
Parameters
api
ICoreClientAPIThe Client API.
args
MouseEventThe arguments for the mouse event.
RecomposeInto(ImageSurface, Context)
public void RecomposeInto(ImageSurface surface, Context ctx)
Parameters
surface
ImageSurfacectx
Context
RecomposeText()
Recomposes the element for lines.
public void RecomposeText()
RenderInteractiveElements(float)
Renders the element as an interactive element.
public override void RenderInteractiveElements(float deltaTime)
Parameters
deltaTime
floatThe change in time.
SetNewText(string, CairoFont, Action<LinkTextComponent>)
public void SetNewText(string vtmlCode, CairoFont baseFont, Action<LinkTextComponent> didClickLink = null)
Parameters
vtmlCode
stringbaseFont
CairoFontdidClickLink
Action<LinkTextComponent>
SetNewText(RichTextComponentBase[])
public void SetNewText(RichTextComponentBase[] comps)
Parameters
comps
RichTextComponentBase[]
SetNewTextWithoutRecompose(string, CairoFont, Action<LinkTextComponent>, bool)
public void SetNewTextWithoutRecompose(string vtmlCode, CairoFont baseFont, Action<LinkTextComponent> didClickLink = null, bool recalcBounds = false)
Parameters
vtmlCode
stringbaseFont
CairoFontdidClickLink
Action<LinkTextComponent>recalcBounds
bool
genTexture()
public void genTexture()