Class Text
Represents a drawable text line
Assembly: SlipeClient.dll
Syntax
public class Text : Dx2DObject, IDrawable
Constructors
|
Improve this Doc
View Source
Text(String, Vector2)
Create a white default text
Declaration
public Text(string text, Vector2 position)
Parameters
|
Improve this Doc
View Source
Text(String, Vector2, Vector2, Color)
Create a default text without explicit scale
Declaration
public Text(string text, Vector2 position, Vector2 bottomRight, Color color)
Parameters
|
Improve this Doc
View Source
Text(String, Vector2, Vector2, Color, Vector2, Font, HorizontalAlign, VerticalAlign, Single)
Create a custom font text without explicit rotation
Declaration
public Text(string text, Vector2 position, Vector2 bottomRight, Color color, Vector2 scale, Font font, HorizontalAlign horizontalAlign = HorizontalAlign.Left, VerticalAlign verticalAlign = VerticalAlign.Top, float fRotation = 0F)
Parameters
|
Improve this Doc
View Source
Text(String, Vector2, Vector2, Color, Vector2, Font, HorizontalAlign, VerticalAlign, Single, Vector2, Boolean, Boolean, Boolean, Boolean, Boolean)
Create a text object with a custom font
Declaration
public Text(string text, Vector2 position, Vector2 bottomRight, Color color, Vector2 scale, Font font, HorizontalAlign horizontalAlign, VerticalAlign verticalAlign, float fRotation, Vector2 fRotationCenter, bool clip = false, bool wordBreak = false, bool postGUI = false, bool colorCoded = false, bool subPixelPositioning = false)
Parameters
|
Improve this Doc
View Source
Text(String, Vector2, Vector2, Color, Vector2, StandardFont, HorizontalAlign, VerticalAlign, Single)
Create a standard font text without explicit rotation
Declaration
public Text(string text, Vector2 position, Vector2 bottomRight, Color color, Vector2 scale, StandardFont font, HorizontalAlign horizontalAlign = HorizontalAlign.Left, VerticalAlign verticalAlign = VerticalAlign.Top, float fRotation = 0F)
Parameters
|
Improve this Doc
View Source
Text(String, Vector2, Vector2, Color, Vector2, StandardFont, HorizontalAlign, VerticalAlign, Single, Vector2, Boolean, Boolean, Boolean, Boolean, Boolean)
Create a text object with a standard font
Declaration
public Text(string text, Vector2 position, Vector2 bottomRight, Color color, Vector2 scale, StandardFont font, HorizontalAlign horizontalAlign, VerticalAlign verticalAlign, float fRotation, Vector2 fRotationCenter, bool clip = false, bool wordBreak = false, bool postGUI = false, bool colorCoded = false, bool subPixelPositioning = false)
Parameters
Fields
|
Improve this Doc
View Source
customFont
Declaration
protected Font customFont
Field Value
|
Improve this Doc
View Source
standardFont
Declaration
protected StandardFont standardFont
Field Value
|
Improve this Doc
View Source
useCustomFont
Declaration
protected bool useCustomFont
Field Value
Properties
|
Improve this Doc
View Source
BottomRight
Absolute coordinates of the bottom right bounding box
Declaration
public Vector2 BottomRight { get; set; }
Property Value
|
Improve this Doc
View Source
Clip
if set to true, the parts of the text that don't fit within the bounding box will be cut off.
Declaration
public bool Clip { get; set; }
Property Value
|
Improve this Doc
View Source
ColorCoded
Set to true to enable embedded #FFFFFF color codes. Note: clip and wordBreak are forced false if this is set.
Declaration
public bool ColorCoded { get; set; }
Property Value
|
Improve this Doc
View Source
Content
Declaration
public string Content { get; set; }
Property Value
|
Improve this Doc
View Source
CustomFont
Declaration
public Font CustomFont { get; set; }
Property Value
|
Improve this Doc
View Source
HorizontalAlignment
Where the text is horizontally aligned in the bounding box
Declaration
public HorizontalAlign HorizontalAlignment { get; set; }
Property Value
|
Improve this Doc
View Source
Rotation
The rotation of this text
Declaration
public float Rotation { get; set; }
Property Value
|
Improve this Doc
View Source
RotationOrigin
The origin of the rotation
Declaration
public Vector2 RotationOrigin { get; set; }
Property Value
|
Improve this Doc
View Source
Scale
The X and Y scale of this text
Declaration
public Vector2 Scale { get; set; }
Property Value
|
Improve this Doc
View Source
StandardFont
The default font of this text
Declaration
public StandardFont StandardFont { get; set; }
Property Value
|
Improve this Doc
View Source
SubPixelPositioning
A bool representing whether the rectangle can be positioned sub-pixel-ly.
Declaration
public bool SubPixelPositioning { get; set; }
Property Value
|
Improve this Doc
View Source
VerticalAlignment
Where the text is vertically aligned in the bounding box
Declaration
public VerticalAlign VerticalAlignment { get; set; }
Property Value
|
Improve this Doc
View Source
WordBreak
if set to true, the text will wrap to a new line whenever it reaches the right side of the bounding box. If false, the text will always be completely on one line.
Declaration
public bool WordBreak { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
Draw(RootElement, OnRenderEventArgs)
Declaration
public bool Draw(RootElement source, OnRenderEventArgs eventArgs)
Parameters
Returns
|
Improve this Doc
View Source
GetTextWidth(String, Single, StandardFont, Boolean)
Declaration
public static float GetTextWidth(string text, float scale = 1F, StandardFont font = StandardFont.Default, bool colorCoded = false)
Parameters
Returns
Implements