hud::HudText Class Reference

Defines a string of text to be displayed in HUD. More...

#include <_src_hud_hud_text.hh>

Inheritance diagram for hud::HudText:

hud::HudObject

List of all members.

Public Types

enum  eOrientation {
  eOrientation_BOTTOM_LEFT, eOrientation_BOTTOM_RIGHT, eOrientation_TOP_LEFT, eOrientation_TOP_RIGHT,
  eOrientation_CENTER
}
 Text orientation. More...
enum  eGradientColor { eGradientColor_TOP_LEFT, eGradientColor_BOTTOM_LEFT, eGradientColor_BOTTOM_RIGHT, eGradientColor_TOP_RIGHT }
 For setting RGBA array passed to SetGradientColors(). More...
enum  eAnimation { eAnimation_NONE, eAnimation_FLIP }
 Specify which kind of text animation. More...

Public Member Functions

 HudText (const Args &args)
 ~HudText ()
void SetText (const string &text)
void SetText (const char text[])
void SetPosition3D (const WorldVertex &pos3)
void SetFontSize (const fp fontSize)
void SetColor (const RGBA rgba)
void SetGradientColors4 (const TinyArray< 4, RGBA > &colors4)
RefPtr< Node > GetNode (void)
void Rotate (const uint axis, const Radian rad)

Private Types

typedef HudObject Parent

Private Member Functions

Vector2 OrientPosition (const Args &args)
virtual void Update (View &view)
void UpdatePosition3D (View &view, const Milliseconds elapsedMilliseconds)
void UpdateAnimation (const Milliseconds elapsedMilliseconds)

Private Attributes

RefPtr< osg::Geode > mGeode
 geometry node
RefPtr< osgText::Text > mOsgText
 drawable node
Definition3D m3D
 3D position enabled by SetPosition3D()
Animation mAnimation

Friends

class Hud

Classes

struct  Animation
struct  Args
 Args for HudText() ctor. More...
struct  Definition3D
 Optional definition of 2D box in 3D terms. Becomes valid after SetPosition3D() is called. More...


Detailed Description

Defines a string of text to be displayed in HUD.

HudText has attributes such as 2D position, orientation, font name/size, color, color gradients, and 3D rotation for animation.


Member Typedef Documentation

typedef HudObject hud::HudText::Parent [private]


Member Enumeration Documentation

Text orientation.

Enumerator:
eOrientation_BOTTOM_LEFT 
eOrientation_BOTTOM_RIGHT 
eOrientation_TOP_LEFT 
eOrientation_TOP_RIGHT 
eOrientation_CENTER 

For setting RGBA array passed to SetGradientColors().

Enumerator:
eGradientColor_TOP_LEFT 
eGradientColor_BOTTOM_LEFT 
eGradientColor_BOTTOM_RIGHT 
eGradientColor_TOP_RIGHT 

Specify which kind of text animation.

Enumerator:
eAnimation_NONE 
eAnimation_FLIP  gradually rotate text from flat to standing up


Constructor & Destructor Documentation

hud::HudText::HudText ( const Args args  ) 

ctor/dtor.

hud::HudText::~HudText (  ) 


Member Function Documentation

void hud::HudText::SetText ( const string &  text  ) 

Change the value of HudText.

void hud::HudText::SetText ( const char  text[]  ) 

void hud::HudText::SetPosition3D ( const WorldVertex &  pos3  ) 

Set position by transforming 3D vertex into 2D.

void hud::HudText::SetFontSize ( const fp  fontSize  ) 

Set font size.

void hud::HudText::SetColor ( const RGBA  rgba  ) 

Set color of text.

void hud::HudText::SetGradientColors4 ( const TinyArray< 4, RGBA > &  colors4  ) 

Set drawing text with 4 gradient colors.

RefPtr<Node> hud::HudText::GetNode ( void   )  [inline]

void hud::HudText::Rotate ( const uint  axis,
const Radian  rad 
)

Rotate text.

Vector2 hud::HudText::OrientPosition ( const Args args  )  [private]

(private ctor subroutine) Re-orient the position of a HudText. The input position must be oriented at BOTTOM_LEFT.

void hud::HudText::Update ( View view  )  [private, virtual]

Update callback.

Implements hud::HudObject.

void hud::HudText::UpdatePosition3D ( View view,
const Milliseconds  elapsedMilliseconds 
) [private]

void hud::HudText::UpdateAnimation ( const Milliseconds  elapsedMilliseconds  )  [private]


Friends And Related Function Documentation

friend class Hud [friend]


Member Data Documentation

RefPtr<osg::Geode> hud::HudText::mGeode [private]

geometry node

RefPtr<osgText::Text> hud::HudText::mOsgText [private]

drawable node

3D position enabled by SetPosition3D()


The documentation for this class was generated from the following files:
Palomino Flight Simulator documents generated by doxygen 1.5.6 on Tue Sep 28 11:37:49 2010