Vertices Engine  v1.9.2.92
A Cross Platform game engine developed by Virtex Edge Design.
Loading...
Searching...
No Matches
VerticesEngine.UI.vxUIText Struct Reference

A helper struct for rendering and positioning text using content, font, position, scale etc... More...

Public Member Functions

 vxUIText (string text, SpriteFont font)
 Create a UI Text element.
 
 vxUIText (string text, SpriteFont font, Vector2 position)
 Create a UI Text element at the specified position.
 
 vxUIText (string text, SpriteFont font, Rectangle bounds, vxLayoutJustification layoutJustification)
 Create a UI Text element anchored within the specified bounds.
 
 vxUIText (string text, SpriteFont font, Rectangle bounds, vxLayoutJustification layoutJustification, Vector2 padding)
 Create a UI Text element anchored within the specified bounds with padding.
 
void AnchorWithinBounds (Rectangle bounds, vxLayoutJustification layoutJustification)
 Anchors the UI text within a point in the bounds.
 
void AnchorWithinBounds (Rectangle bounds, vxLayoutJustification layoutJustification, Vector2 padding)
 Anchors the UI text within a point in the bounds with padding.
 
void ClearScale ()
 Clears the scale and resets it back to Vector2.One.
 
void DrawText (Color textColor)
 Draws the vxUIText with a shadow.
 
void DrawText (Color textColor, float shadowTint, Vector2 shadowOffset)
 Draws the vxUIText with a shadow.
 
void DrawText (Color textColor, Color shadowColour, Vector2 shadowOffset)
 Draws the vxUIText with a shadow.
 

Public Attributes

Vector2 _scale
 

Properties

string Text [get, set]
 
SpriteFont Font [get, set]
 
Vector2 Position [get, set]
 
Vector2 Size [get]
 The size of the text for the given font.
 
Vector2 Scale [get, set]
 Scale of the UI Element. This defaults to vxLayout.Scale. Call ClearScale() to reset to 1.
 
Rectangle Bounds [get]
 The bounds of the text for the given font, size and position.
 
vxLayoutJustification Justification [get, set]
 Get or Set the Text Justification, such as Top Left, Middle Center, Bottom Right etc..
 

Detailed Description

A helper struct for rendering and positioning text using content, font, position, scale etc...

Constructor & Destructor Documentation

◆ vxUIText() [1/4]

VerticesEngine.UI.vxUIText.vxUIText ( string text,
SpriteFont font )

Create a UI Text element.

Parameters
text
font

◆ vxUIText() [2/4]

VerticesEngine.UI.vxUIText.vxUIText ( string text,
SpriteFont font,
Vector2 position )

Create a UI Text element at the specified position.

Parameters
text
font
position

◆ vxUIText() [3/4]

VerticesEngine.UI.vxUIText.vxUIText ( string text,
SpriteFont font,
Rectangle bounds,
vxLayoutJustification layoutJustification )

Create a UI Text element anchored within the specified bounds.

Parameters
text
font
bounds
layoutJustification

◆ vxUIText() [4/4]

VerticesEngine.UI.vxUIText.vxUIText ( string text,
SpriteFont font,
Rectangle bounds,
vxLayoutJustification layoutJustification,
Vector2 padding )

Create a UI Text element anchored within the specified bounds with padding.

Parameters
text
font
bounds
layoutJustification
padding

Member Function Documentation

◆ AnchorWithinBounds()

void VerticesEngine.UI.vxUIText.AnchorWithinBounds ( Rectangle bounds,
vxLayoutJustification layoutJustification,
Vector2 padding )

Anchors the UI text within a point in the bounds with padding.

Parameters
bounds
layoutJustification
padding

◆ DrawText() [1/3]

void VerticesEngine.UI.vxUIText.DrawText ( Color textColor)

Draws the vxUIText with a shadow.

Parameters
textColorText colour to draw the text to the screen with

◆ DrawText() [2/3]

void VerticesEngine.UI.vxUIText.DrawText ( Color textColor,
Color shadowColour,
Vector2 shadowOffset )

Draws the vxUIText with a shadow.

Parameters
textColorText colour to draw the text to the screen with
shadowColourText shadow colour to draw the text to the screen with
shadowOffsetDrop shadow offset

◆ DrawText() [3/3]

void VerticesEngine.UI.vxUIText.DrawText ( Color textColor,
float shadowTint,
Vector2 shadowOffset )

Draws the vxUIText with a shadow.

Parameters
textColorText colour to draw the text to the screen with
shadowTintText shadow tint to draw the text to the screen with. This assumes the shadow is Color.Black
shadowOffsetDrop shadow offset

The documentation for this struct was generated from the following file: