3DRadSpace  v1.0.0a
Scripting documentation
_3DRadSpaceDll.TextPrint Class Reference

Class for drawing 2D Texts. More...

Inheritance diagram for _3DRadSpaceDll.TextPrint:
_3DRadSpaceDll.GameObject

Public Member Functions

 TextPrint (string name, bool active, string font, string text, Vector2 pos, Vector2 size, float rotation=0, Vector2 cof=default, Color col=default, SpriteEffects effects=SpriteEffects.None, int layer=0)
 TextPrint constructor. More...
 
 TextPrint ()
 Empty TextPrint constructor. More...
 
override void Load (ContentManager content)
 Loads the font. More...
 
override void Draw (SpriteBatch spriteBatch, Matrix? view, Matrix? projection)
 Draws the text to the game screen. More...
 
override void EditorDraw (SpriteBatch spriteBatch, Matrix? view, Matrix? projection)
 Draws the text for the editor. More...
 
void Dispose ()
 Disposes the font's texture More...
 
- Public Member Functions inherited from _3DRadSpaceDll.GameObject
 GameObject ()
 Default constructor. More...
 
void Enable ()
 Enables object. More...
 
void Disable ()
 Disables object. More...
 
void Toggle ()
 Switches object on/off state. More...
 
void Show ()
 Shows the object. More...
 
void Hide ()
 Hides the object. More...
 
virtual void Update (MouseState mouse, KeyboardState keyboard, GameTime time)
 Object update logic More...
 
virtual void Trigger ()
 This is specific to objects like ExitFade, NetServer,etc More...
 
override bool Equals (object obj)
 Determines whether the specified object is equal to the current object. More...
 
override int GetHashCode ()
 Returns the hash code calculated from a string representing the data inside the object. More...
 
override string ToString ()
 Returns the object's name More...
 
void RunOnce ()
 Runs the object one Update loop. If used on a active object it will be stopped. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Not really needed, MG's pipeline takes care of the SpriteFont instance. More...
 

Properties

string Text [get, set]
 Text to be drawn More...
 
new Vector2 Position [get, set]
 Position in 2D space of the text. More...
 
Vector2 Size [get, set]
 Size of the text. More...
 
new float Rotation [get, set]
 Text rotation. More...
 
SpriteFont Font [get, set]
 Font used for drawing the text. More...
 
Color Color [get, set]
 Text Color. More...
 
Vector2 Center [get, set]
 Center of rotation. More...
 
SpriteEffects Effects [get, set]
 Allows flipping More...
 
float Layer [get, set]
 Depth layer. More...
 
- Properties inherited from _3DRadSpaceDll.GameObject
string Name [get, set]
 Object Name. Used as a string identifier. More...
 
object Tag [get, set]
 Tag object. More...
 
bool Enabled [get, set]
 Checks if object is enabled. More...
 
bool Hidden [get, set]
 Checks if object is being drawn. More...
 
List< ObjectBehiavourBehiavours [get, set]
 Relation with other objects More...
 
Quaternion RotationQuaternion [get]
 Rotation in a Quaterion system. More...
 
string Resource [get, set]
 Resource file More...
 

Additional Inherited Members

- Static Public Member Functions inherited from _3DRadSpaceDll.GameObject
static implicit operator bool (GameObject o)
 Checks if the object exists. Same as GameObject != null. More...
 
static bool operator== (GameObject a, GameObject b)
 Checks if two GameObjects are equal. More...
 
static bool operator!= (GameObject a, GameObject b)
 The opposite of the equality operator. More...
 
- Public Attributes inherited from _3DRadSpaceDll.GameObject
Vector3 Position
 Object position More...
 
Vector3 Rotation
 Rotation in a Euler angles system. More...
 
List< int > SelectedObjects
 Used for editor. More...
 
- Events inherited from _3DRadSpaceDll.GameObject
onDraw OnDraw
 Called when object is being drawn on frame. More...
 
onUpdate OnUpdate
 Called when object is being updated on the update logic loop. More...
 
onObjectDestroy OnRemoval
 Called when object is being deleted. More...
 
onObjectLoad OnObjectLoad
 Called when a object resource is being loaded. More...
 

Detailed Description

Class for drawing 2D Texts.

Constructor & Destructor Documentation

◆ TextPrint() [1/2]

_3DRadSpaceDll.TextPrint.TextPrint ( string  name,
bool  active,
string  font,
string  text,
Vector2  pos,
Vector2  size,
float  rotation = 0,
Vector2  cof = default,
Color  col = default,
SpriteEffects  effects = SpriteEffects.None,
int  layer = 0 
)

TextPrint constructor.

Parameters
nameObject name
activeWill this object draw?
textText to print
posPosition on the screen
sizeSize
rotationRotation in radians(?)
fontFont used for drawing.
cofCenter of rotation.
colText color.
effectsFlipping options.
layerDepth layer.

◆ TextPrint() [2/2]

_3DRadSpaceDll.TextPrint.TextPrint ( )

Empty TextPrint constructor.

Member Function Documentation

◆ Dispose() [1/2]

void _3DRadSpaceDll.TextPrint.Dispose ( )

Disposes the font's texture

◆ Dispose() [2/2]

virtual void _3DRadSpaceDll.TextPrint.Dispose ( bool  disposing)
protectedvirtual

Not really needed, MG's pipeline takes care of the SpriteFont instance.

Parameters
disposing

◆ Draw()

override void _3DRadSpaceDll.TextPrint.Draw ( SpriteBatch  spriteBatch,
Matrix?  view,
Matrix?  projection 
)
virtual

Draws the text to the game screen.

Parameters
spriteBatchSpriteBatch used for drawing the text.
viewNot used.
projectionNot used.

Reimplemented from _3DRadSpaceDll.GameObject.

◆ EditorDraw()

override void _3DRadSpaceDll.TextPrint.EditorDraw ( SpriteBatch  spriteBatch,
Matrix?  view,
Matrix?  projection 
)
virtual

Draws the text for the editor.

Parameters
spriteBatch
view
projection

Reimplemented from _3DRadSpaceDll.GameObject.

◆ Load()

override void _3DRadSpaceDll.TextPrint.Load ( ContentManager  content)
virtual

Loads the font.

Parameters
content

Reimplemented from _3DRadSpaceDll.GameObject.

Property Documentation

◆ Center

Vector2 _3DRadSpaceDll.TextPrint.Center
getset

Center of rotation.

◆ Color

Color _3DRadSpaceDll.TextPrint.Color
getset

Text Color.

◆ Effects

SpriteEffects _3DRadSpaceDll.TextPrint.Effects
getset

Allows flipping

◆ Font

SpriteFont _3DRadSpaceDll.TextPrint.Font
getset

Font used for drawing the text.

◆ Layer

float _3DRadSpaceDll.TextPrint.Layer
getset

Depth layer.

◆ Position

new Vector2 _3DRadSpaceDll.TextPrint.Position
getset

Position in 2D space of the text.

◆ Rotation

new float _3DRadSpaceDll.TextPrint.Rotation
getset

Text rotation.

◆ Size

Vector2 _3DRadSpaceDll.TextPrint.Size
getset

Size of the text.

◆ Text

string _3DRadSpaceDll.TextPrint.Text
getset

Text to be drawn