Text Class Reference

#include <text.h>

Inheritance diagram for Text:

FlashText

List of all members.


Detailed Description

Definition at line 33 of file text.h.


Public Member Functions

 Text (const std::string &text, int x, int y, gcn::Graphics::Alignment alignment, const gcn::Color *color, bool isSpeech=false)
 Constructor creates a text object to display on the screen.
virtual ~Text ()
 Destructor.
void setColor (const gcn::Color *color)
int getWidth () const
int getHeight () const
void adviseXY (int x, int y)
 Allows the originator of the text to specify the ideal coordinates.
virtual void draw (gcn::Graphics *graphics, int xOff, int yOff)
 Draws the text.

Static Protected Attributes

static ImageRect mBubble
 Speech bubble graphic.
static ImagemBubbleArrow
 Speech bubble arrow graphic.

Private Attributes

int mX
 Actual x-value of left of text written.
int mY
 Actual y-value of top of text written.
int mWidth
 The width of the text.
int mHeight
 The height of the text.
int mXOffset
 The offset of mX from the desired x.
std::string mText
 The text to display.
const gcn::Color * mColor
 The color of the text.
bool mIsSpeech
 Is this text a speech bubble?

Static Private Attributes

static int mInstances = 0
 Instances of text.

Friends

class TextManager

Constructor & Destructor Documentation

Text::Text ( const std::string &  text,
int  x,
int  y,
gcn::Graphics::Alignment  alignment,
const gcn::Color *  color,
bool  isSpeech = false 
)

Constructor creates a text object to display on the screen.

Definition at line 40 of file text.cpp.

Text::~Text (  )  [virtual]

Destructor.

The text is removed from the screen.

Definition at line 92 of file text.cpp.


Member Function Documentation

void Text::setColor ( const gcn::Color *  color  ) 

Definition at line 112 of file text.cpp.

int Text::getWidth ( void   )  const [inline]

Definition at line 52 of file text.h.

int Text::getHeight ( void   )  const [inline]

Definition at line 53 of file text.h.

void Text::adviseXY ( int  x,
int  y 
)

Allows the originator of the text to specify the ideal coordinates.

Definition at line 117 of file text.cpp.

void Text::draw ( gcn::Graphics *  graphics,
int  xOff,
int  yOff 
) [virtual]

Draws the text.

Reimplemented in FlashText.

Definition at line 122 of file text.cpp.


Friends And Related Function Documentation

friend class TextManager [friend]

Definition at line 35 of file text.h.


Member Data Documentation

int Text::mX [private]

Actual x-value of left of text written.

Definition at line 66 of file text.h.

int Text::mY [private]

Actual y-value of top of text written.

Definition at line 67 of file text.h.

int Text::mWidth [private]

The width of the text.

Definition at line 68 of file text.h.

int Text::mHeight [private]

The height of the text.

Definition at line 69 of file text.h.

int Text::mXOffset [private]

The offset of mX from the desired x.

Definition at line 70 of file text.h.

int Text::mInstances = 0 [static, private]

Instances of text.

Definition at line 71 of file text.h.

std::string Text::mText [private]

The text to display.

Definition at line 72 of file text.h.

const gcn::Color* Text::mColor [private]

The color of the text.

Definition at line 73 of file text.h.

bool Text::mIsSpeech [private]

Is this text a speech bubble?

Definition at line 74 of file text.h.

ImageRect Text::mBubble [static, protected]

Speech bubble graphic.

Definition at line 77 of file text.h.

Image * Text::mBubbleArrow [static, protected]

Speech bubble arrow graphic.

Definition at line 78 of file text.h.


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

Generated on Sun Apr 26 17:30:44 2009 for The Mana World by  doxygen 1.5.5