Class GuiElementTextBase
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
public class GuiElementTextBase : GuiElementControl, IDisposable
- Inheritance
-
GuiElementTextBase
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
GuiElementTextBase(ICoreClientAPI, string, CairoFont, ElementBounds)
Creates a new text based element.
public GuiElementTextBase(ICoreClientAPI capi, string text, CairoFont font, ElementBounds bounds)
Parameters
capiICoreClientAPIThe Client API
textstringThe text of this element.
fontCairoFontThe font of the text.
boundsElementBoundsThe bounds of the element.
Fields
Font
The font of the Text Element.
public CairoFont Font
Field Value
RightPadding
protected float RightPadding
Field Value
text
protected string text
Field Value
textPathMode
Whether or not the text path mode is active.
public bool textPathMode
Field Value
textUtil
public TextDrawUtil textUtil
Field Value
Properties
Text
public string Text { get; set; }
Property Value
Methods
ComposeElements(Context, ImageSurface)
Composes the elements.
public override void ComposeElements(Context ctx, ImageSurface surface)
Parameters
ctxContextsurfaceImageSurfaceThe surface of the GUI.
ComposeTextElements(Context, ImageSurface)
public virtual void ComposeTextElements(Context ctx, ImageSurface surface)
Parameters
ctxContextsurfaceImageSurface
DrawMultilineTextAt(Context, double, double, EnumTextOrientation)
public double DrawMultilineTextAt(Context ctx, double posX, double posY, EnumTextOrientation orientation = EnumTextOrientation.Left)
Parameters
ctxContextposXdoubleposYdoubleorientationEnumTextOrientation
Returns
DrawTextLineAt(Context, string, double, double, bool)
Draws the line of text on a component.
public void DrawTextLineAt(Context ctx, string text, double posX, double posY, bool textPathMode = false)
Parameters
ctxContextThe context of the text
textstringThe text of the text.
posXdoubleThe X Position of the text.
posYdoubleThe Y position of the text.
textPathModeboolThe pathing mode.
GetMultilineTextHeight()
public double GetMultilineTextHeight()
Returns
GetText()
Gets the text on the element.
public virtual string GetText()
Returns
- string
The text of the element.