Show / Hide Table of Contents

Class Text

Represents a drawable text line

Inheritance
Object
LazyAttachableObject
Dx2DObject
Text
Implements
IDrawable
Inherited Members
Dx2DObject.Color
Dx2DObject.Position
Dx2DObject.PostGUI
Dx2DObject.Update(RootElement, OnUpdateEventArgs)
LazyAttachableObject.toAttached
LazyAttachableObject.Offset
LazyAttachableObject.ToAttached
LazyAttachableObject.IsAttached
LazyAttachableObject.AttachTo(PhysicalElement, Matrix4x4)
LazyAttachableObject.AttachTo(PhysicalElement, Vector3, Vector3)
LazyAttachableObject.AttachTo(PhysicalElement, Vector3, Quaternion)
LazyAttachableObject.AttachTo(PhysicalElement)
LazyAttachableObject.Detach()
LazyAttachableObject.OnAttach()
LazyAttachableObject.OnDetach()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Slipe.Client.Dx
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
Type Name Description
String text
Vector2 position
| 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
Type Name Description
String text
Vector2 position
Vector2 bottomRight
Color color
| 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
Type Name Description
String text
Vector2 position
Vector2 bottomRight
Color color
Vector2 scale
Font font
HorizontalAlign horizontalAlign
VerticalAlign verticalAlign
Single fRotation
| 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
Type Name Description
String text
Vector2 position
Vector2 bottomRight
Color color
Vector2 scale
Font font
HorizontalAlign horizontalAlign
VerticalAlign verticalAlign
Single fRotation
Vector2 fRotationCenter
Boolean clip
Boolean wordBreak
Boolean postGUI
Boolean colorCoded
Boolean subPixelPositioning
| 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
Type Name Description
String text
Vector2 position
Vector2 bottomRight
Color color
Vector2 scale
StandardFont font
HorizontalAlign horizontalAlign
VerticalAlign verticalAlign
Single fRotation
| 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
Type Name Description
String text
Vector2 position
Vector2 bottomRight
Color color
Vector2 scale
StandardFont font
HorizontalAlign horizontalAlign
VerticalAlign verticalAlign
Single fRotation
Vector2 fRotationCenter
Boolean clip
Boolean wordBreak
Boolean postGUI
Boolean colorCoded
Boolean subPixelPositioning

Fields

| Improve this Doc View Source

customFont

Declaration
protected Font customFont
Field Value
Type Description
Font
| Improve this Doc View Source

standardFont

Declaration
protected StandardFont standardFont
Field Value
Type Description
StandardFont
| Improve this Doc View Source

useCustomFont

Declaration
protected bool useCustomFont
Field Value
Type Description
Boolean

Properties

| Improve this Doc View Source

BottomRight

Absolute coordinates of the bottom right bounding box

Declaration
public Vector2 BottomRight { get; set; }
Property Value
Type Description
Vector2
| 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
Type Description
Boolean
| 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
Type Description
Boolean
| Improve this Doc View Source

Content

The text of this element

Declaration
public string Content { get; set; }
Property Value
Type Description
String
| Improve this Doc View Source

CustomFont

The font of this text

Declaration
public Font CustomFont { get; set; }
Property Value
Type Description
Font
| Improve this Doc View Source

HorizontalAlignment

Where the text is horizontally aligned in the bounding box

Declaration
public HorizontalAlign HorizontalAlignment { get; set; }
Property Value
Type Description
HorizontalAlign
| Improve this Doc View Source

Rotation

The rotation of this text

Declaration
public float Rotation { get; set; }
Property Value
Type Description
Single
| Improve this Doc View Source

RotationOrigin

The origin of the rotation

Declaration
public Vector2 RotationOrigin { get; set; }
Property Value
Type Description
Vector2
| Improve this Doc View Source

Scale

The X and Y scale of this text

Declaration
public Vector2 Scale { get; set; }
Property Value
Type Description
Vector2
| Improve this Doc View Source

StandardFont

The default font of this text

Declaration
public StandardFont StandardFont { get; set; }
Property Value
Type Description
StandardFont
| 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
Type Description
Boolean
| Improve this Doc View Source

VerticalAlignment

Where the text is vertically aligned in the bounding box

Declaration
public VerticalAlign VerticalAlignment { get; set; }
Property Value
Type Description
VerticalAlign
| 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
Type Description
Boolean

Methods

| Improve this Doc View Source

Draw(RootElement, OnRenderEventArgs)

Declaration
public bool Draw(RootElement source, OnRenderEventArgs eventArgs)
Parameters
Type Name Description
RootElement source
OnRenderEventArgs eventArgs
Returns
Type Description
Boolean
| 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
Type Name Description
String text
Single scale
StandardFont font
Boolean colorCoded
Returns
Type Description
Single

Implements

IDrawable
  • Improve this Doc
  • View Source
Back to top Generated by DocFX