TextGeometry Class Reference

This reference page is linked to from the following overview topics: Using the C++ Classes.



Detailed Description

TextGeometry is used for displaying text in the scene.

The text, font and color can be specified. Placement and size can be manipulated using this node's transformation matrix.

#include <TextGeometry.h>

Inheritance diagram for TextGeometry:
Inheritance graph
[legend]

List of all members.

Public Types

enum   Alignment { kLeft, kCentre, kCenter = kCentre, kRight }
enum   { kDirtyText = Geometry::kLastDirty, kDirtyFont, kDirtyTextProperties, kLastDirty }

Public Member Functions

  TextGeometry ()
  TextGeometry (const TextGeometry &)
TextGeometry operator= (const TextGeometry &)
virtual void  accept (NodeVisitor &)
void  setText (const awString::IString &text)
const awString::IString &  getText () const
void  setFont (const awString::IString &font)
  Currently, set and get the font to use for this text.
const awString::IString &  getFont () const
void  setColor (float r, float g, float b, float a)
void  getColor (float &r, float &g, float &b, float &a) const
void  setHeight (float height)
  Set the desired height of the text in pixels.
float  getHeight () const
void  setWidth (float width)
  Set the desired width of the text in pixels.
float  getWidth () const
void  setAlignment (Alignment alignment)
Alignment  getAlignment () const
void  setTextTransform (const awLinear::AffineMatrix &matrix)
const awLinear::AffineMatrix &  getTextTransform () const
virtual void  setAllDirty (bool dirty)

Protected Member Functions

virtual  ~TextGeometry ()
  Reference counted objects shouldn't exist on the stack.

Member Enumeration Documentation


Constructor & Destructor Documentation

TextGeometry ( const TextGeometry )
virtual ~TextGeometry ( ) [protected, virtual]

Reference counted objects shouldn't exist on the stack.


Member Function Documentation

TextGeometry& operator= ( const TextGeometry )
virtual void accept ( NodeVisitor ) [virtual]
void setText ( const awString::IString &  text )
const awString::IString& getText ( ) const
void setFont ( const awString::IString &  font )

Currently, set and get the font to use for this text.

If the font is not valid, a default font is used.

const awString::IString& getFont ( ) const
void setColor ( float  r,
float  g,
float  b,
float  a 
)
void getColor ( float &  r,
float &  g,
float &  b,
float &  a 
) const
void setHeight ( float  height )

Set the desired height of the text in pixels.

NOTE: Any value should work fine but the text will look the clearest when the height is 16 or 32. Text height is 16 by default.

float getHeight ( ) const
void setWidth ( float  width )

Set the desired width of the text in pixels.

If a width is not set then all of the text will be drawn. When a width is specified then only the text that fits will be drawn.

NOTE: When the text doesn't fit ellipses are drawn.

float getWidth ( ) const
void setAlignment ( Alignment  alignment )
Alignment getAlignment ( ) const
void setTextTransform ( const awLinear::AffineMatrix &  matrix )
const awLinear::AffineMatrix& getTextTransform ( ) const
virtual void setAllDirty ( bool  dirty ) [virtual]

Reimplemented from Node.


TextGeometry TextGeometry TextGeometry TextGeometry TextGeometry TextGeometry TextGeometry TextGeometry TextGeometry TextGeometry
TextGeometry TextGeometry TextGeometry TextGeometry TextGeometry TextGeometry TextGeometry TextGeometry TextGeometry TextGeometry