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...
 
math::Box GetAABB ()
 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

§ HorizAlign

enum HorizAlign

Horizontal alignment.

Enumerator
H_LEFT 

Left alignment.

H_CENTER 

Center alignment.

§ VertAlign

enum VertAlign

vertical alignment

Enumerator
V_BELOW 

Align below.

V_ABOVE 

Align above.

Constructor & Destructor Documentation

§ MovableText()

Constructor.

§ ~MovableText()

virtual ~MovableText ( )
virtual

Destructor.

Member Function Documentation

§ _setupGeometry()

void _setupGeometry ( )
protected

§ _updateColors()

void _updateColors ( )
protected

§ GetAABB()

math::Box GetAABB ( )

Get the axis aligned bounding box of the text.

Returns
The axis aligned bounding box.

§ GetBaseline()

float GetBaseline ( ) const

Get the baseline height.

Returns
Baseline height

§ getBoundingRadius()

float getBoundingRadius ( ) const
protected

§ GetCharHeight()

float GetCharHeight ( ) const

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

§ GetColor()

const common::Color& GetColor ( ) const

Get the text color.

Returns
Texture color.

§ GetFont()

const std::string& GetFont ( ) const

Get the font.

Returns
The font name

§ getLights()

const Ogre::LightList& getLights ( void  ) const
protected

§ getMaterial()

const Ogre::MaterialPtr& getMaterial ( void  ) const
protected

§ getRenderOperation()

void getRenderOperation ( Ogre::RenderOperation &  op)
protected

§ GetShowOnTop()

bool GetShowOnTop ( ) const

True = text is displayed on top.

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

§ GetSpaceWidth()

float GetSpaceWidth ( ) const

Get the width of a space.

Returns
Space width

§ getSquaredViewDepth()

float getSquaredViewDepth ( const Ogre::Camera *  cam) const
protected

§ GetText()

const std::string& GetText ( ) const

Get the displayed text.

Returns
The displayed text.

§ getWorldTransforms()

void getWorldTransforms ( Ogre::Matrix4 *  xform) const
protected

§ Load()

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

§ SetBaseline()

void SetBaseline ( float  _height)

Set the baseline height of the text.

Parameters
[in]_heightBaseline height

§ SetCharHeight()

void SetCharHeight ( float  _height)

Set the height of a character.

Parameters
[in]_heightHeight of the characters.

§ SetColor()

void SetColor ( const common::Color _color)

Set the text color.

Parameters
[in]_colorText color.

§ SetFontName()

void SetFontName ( const std::string &  _font)

Set the font.

Parameters
[in]_fontName of the font

§ SetShowOnTop()

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.

§ SetSpaceWidth()

void SetSpaceWidth ( float  _width)

Set the width of a space.

Parameters
[in]_widthspace width

§ SetText()

void SetText ( const std::string &  _text)

Set the text to display.

Parameters
[in]_textThe text to display.

§ SetTextAlignment()

void SetTextAlignment ( const HorizAlign _hAlign,
const VertAlign _vAlign 
)

Set the alignment of the text.

Parameters
[in]_hAlignHorizontal alignment
[in]_vAlignVertical alignment

§ Update()

void Update ( )

Update the text.

§ visitRenderables()

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

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