TriEngine  v0.0.16
General-purpose engine in C#/OpenGL
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
TriDevs.TriEngine.Text.TextObject Class Reference

Implements the ITextObject interface. More...

Inheritance diagram for TriDevs.TriEngine.Text.TextObject:
[legend]
Collaboration diagram for TriDevs.TriEngine.Text.TextObject:
[legend]

Public Member Functions

 TextObject (string text, string fontName, Point< int > position=new Point< int >(), QFontAlignment alignment=QFontAlignment.Centre)
 
 TextObject (string text, Font font, Point< int > position=new Point< int >(), QFontAlignment alignment=QFontAlignment.Centre)
 Initializes a new TextObject instance. More...
 
void Draw ()
 Draws this text object to screen with default parameters. More...
 
void Draw (Point< int > position)
 Draws this text object to a specific position on the screen specified by the supplied Point struct. More...
 
void Draw (int x, int y)
 Draws this text oject to screen at the specified X/Y position. More...
 

Properties

Font Font [get, set]
 
Color Color [get, set]
 
string Text [get, set]
 
Point< int > Position [get, set]
 
Rectangle Bounds [get]
 
QFontAlignment Alignment [get, set]
 
- Properties inherited from TriDevs.TriEngine.Text.ITextObject
Font Font [get]
 Gets the Font font instance associated with this text object. More...
 
string Text [get, set]
 Gets or sets the text value of this text object. More...
 
Color Color [get, set]
 Gets or sets the color of the text. More...
 
Point< int > Position [get, set]
 Gets or sets the screen position of this text, in pixels. More...
 
Rectangle Bounds [get]
 Gets the bounds of this text object. More...
 
QFontAlignment Alignment [get, set]
 Gets or sets a QFontAlignment value to manage how this text is aligned on screen. More...
 

Detailed Description

Implements the ITextObject interface.

Constructor & Destructor Documentation

TriDevs.TriEngine.Text.TextObject.TextObject ( string  text,
string  fontName,
Point< int >  position = new Point<int>(),
QFontAlignment  alignment = QFontAlignment.Centre 
)
73  : this(text, Resources.ResourceManager.Get<Font>(fontName), position, alignment)
74  {
75 
76  }
TriDevs.TriEngine.Text.TextObject.TextObject ( string  text,
Font  font,
Point< int >  position = new Point<int>(),
QFontAlignment  alignment = QFontAlignment.Centre 
)

Initializes a new TextObject instance.

Parameters
textThe initial text to set for this text object.
fontThe font to use for this text object.
positionThe intitial position of this text object.
alignmentThe intitial alignment of the text in this text object.
87  {
88  if (font == null)
89  throw new EngineException("Font supplied for TextObject is null!", new ArgumentNullException("font"));
90 
91  Text = text;
92  Font = font;
93  Position = position;
94  Alignment = alignment;
95  }

Member Function Documentation

void TriDevs.TriEngine.Text.TextObject.Draw ( )

Draws this text object to screen with default parameters.

Implements TriDevs.TriEngine.Text.ITextObject.

104  {
105  Draw(_vectorPos);
106  }
void TriDevs.TriEngine.Text.TextObject.Draw ( Point< int >  position)

Draws this text object to a specific position on the screen specified by the supplied Point struct.

Parameters
positionPoint class with X/Y coordinates.

Implements TriDevs.TriEngine.Text.ITextObject.

109  {
110  Draw(position.X, position.Y);
111  }
void TriDevs.TriEngine.Text.TextObject.Draw ( int  x,
int  y 
)

Draws this text oject to screen at the specified X/Y position.

Parameters
x
y

Implements TriDevs.TriEngine.Text.ITextObject.

114  {
115  Draw(new Vector2(x, y));
116  }

Property Documentation

QFontAlignment TriDevs.TriEngine.Text.TextObject.Alignment
getset
Rectangle TriDevs.TriEngine.Text.TextObject.Bounds
get
Color TriDevs.TriEngine.Text.TextObject.Color
getset
Font TriDevs.TriEngine.Text.TextObject.Font
getset
Point<int> TriDevs.TriEngine.Text.TextObject.Position
getset
string TriDevs.TriEngine.Text.TextObject.Text
getset

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