MovableText Class Reference

Movable text. More...

#include <rendering/rendering.hh>

Inherits MovableObject, and Renderable.

Public Types

enum  HorizAlign { H_LEFT, H_CENTER }
 Horizontal alignment. More...
 
enum  VertAlign { V_BELOW, V_ABOVE }
 vertical alignment More...
 

Public Member Functions

 MovableText ()
 Constructor. More...
 
virtual ~MovableText ()
 Destructor. More...
 
ignition::math::Box AABB ()
 Get the axis aligned bounding box of the text. More...
 
float GetBaseline () const
 Get the baseline height. More...
 
float GetCharHeight () const
 Set the height of a characters return Height of the characters. More...
 
const common::ColorGetColor () const
 Get the text color. More...
 
const std::string & GetFont () const
 Get the font. More...
 
bool GetShowOnTop () const
 True = text is displayed on top. More...
 
float GetSpaceWidth () const
 Get the width of a space. More...
 
const std::string & GetText () const
 Get the displayed text. More...
 
void Load (const std::string &_name, const std::string &_text, const std::string &_fontName="Arial", float _charHeight=1.0, const common::Color &_color=common::Color::White)
 Loads text and font info. More...
 
void SetBaseline (float _height)
 Set the baseline height of the text. More...
 
void SetCharHeight (float _height)
 Set the height of a character. More...
 
void SetColor (const common::Color &_color)
 Set the text color. More...
 
void SetFontName (const std::string &_font)
 Set the font. More...
 
void SetShowOnTop (bool _show)
 True = text always is displayed ontop. More...
 
void SetSpaceWidth (float _width)
 Set the width of a space. More...
 
void SetText (const std::string &_text)
 Set the text to display. More...
 
void SetTextAlignment (const HorizAlign &_hAlign, const VertAlign &_vAlign)
 Set the alignment of the text. More...
 
void Update ()
 Update the text. More...
 
virtual void visitRenderables (Ogre::Renderable::Visitor *_visitor, bool _debug=false)
 

Protected Member Functions

void _setupGeometry ()
 
void _updateColors ()
 
float getBoundingRadius () const
 
const Ogre::LightList & getLights (void) const
 
const Ogre::MaterialPtr & getMaterial (void) const
 
void getRenderOperation (Ogre::RenderOperation &op)
 
float getSquaredViewDepth (const Ogre::Camera *cam) const
 
void getWorldTransforms (Ogre::Matrix4 *xform) const
 

Detailed Description

Movable text.

Member Enumeration Documentation

enum HorizAlign

Horizontal alignment.

Enumerator
H_LEFT 

Left alignment.

H_CENTER 

Center alignment.

enum VertAlign

vertical alignment

Enumerator
V_BELOW 

Align below.

V_ABOVE 

Align above.

Constructor & Destructor Documentation

Constructor.

virtual ~MovableText ( )
virtual

Destructor.

Member Function Documentation

void _setupGeometry ( )
protected
void _updateColors ( )
protected
ignition::math::Box AABB ( )

Get the axis aligned bounding box of the text.

Returns
The axis aligned bounding box.
float GetBaseline ( ) const

Get the baseline height.

Returns
Baseline height
float getBoundingRadius ( ) const
protected
float GetCharHeight ( ) const

Set the height of a characters return Height of the characters.

const common::Color& GetColor ( ) const

Get the text color.

Returns
Texture color.
const std::string& GetFont ( ) const

Get the font.

Returns
The font name
const Ogre::LightList& getLights ( void  ) const
protected
const Ogre::MaterialPtr& getMaterial ( void  ) const
protected
void getRenderOperation ( Ogre::RenderOperation &  op)
protected
bool GetShowOnTop ( ) const

True = text is displayed on top.

Returns
True if MovableText::SetShownOnTop(true) was called.
float GetSpaceWidth ( ) const

Get the width of a space.

Returns
Space width
float getSquaredViewDepth ( const Ogre::Camera *  cam) const
protected
const std::string& GetText ( ) const

Get the displayed text.

Returns
The displayed text.
void getWorldTransforms ( Ogre::Matrix4 *  xform) const
protected
void Load ( const std::string &  _name,
const std::string &  _text,
const std::string &  _fontName = "Arial",
float  _charHeight = 1.0,
const common::Color _color = common::Color::White 
)

Loads text and font info.

Parameters
[in]_nameName of the text object
[in]_textText to render
[in]_fontNameFont to use
[in]_charHeightHeight of the characters
[in]_colorText color
void SetBaseline ( float  _height)

Set the baseline height of the text.

Parameters
[in]_heightBaseline height
void SetCharHeight ( float  _height)

Set the height of a character.

Parameters
[in]_heightHeight of the characters.
void SetColor ( const common::Color _color)

Set the text color.

Parameters
[in]_colorText color.
void SetFontName ( const std::string &  _font)

Set the font.

Parameters
[in]_fontName of the font
void SetShowOnTop ( bool  _show)

True = text always is displayed ontop.

Parameters
[in]_showSet to true to render the text on top of all other drawables.
void SetSpaceWidth ( float  _width)

Set the width of a space.

Parameters
[in]_widthspace width
void SetText ( const std::string &  _text)

Set the text to display.

Parameters
[in]_textThe text to display.
void SetTextAlignment ( const HorizAlign _hAlign,
const VertAlign _vAlign 
)

Set the alignment of the text.

Parameters
[in]_hAlignHorizontal alignment
[in]_vAlignVertical alignment
void Update ( )

Update the text.

virtual void visitRenderables ( Ogre::Renderable::Visitor *  _visitor,
bool  _debug = false 
)
virtual

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