Mana
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
Text Class Reference

#include <text.h>

Inheritance diagram for Text:
FlashText

Public Member Functions

 Text (const std::string &text, int x, int y, gcn::Graphics::Alignment alignment, const gcn::Color *color, bool isSpeech=false, gcn::Font *font=nullptr)
 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.
 

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.
 
gcn::Font * mFont
 The font of the text.
 
bool mIsSpeech
 Is this text a speech bubble?
 

Static Private Attributes

static int mInstances = 0
 Instances of text.
 

Friends

class TextManager
 

Detailed Description

Definition at line 33 of file text.h.

Constructor & Destructor Documentation

◆ Text()

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

Constructor creates a text object to display on the screen.

Definition at line 35 of file text.cpp.

◆ ~Text()

Text::~Text ( )
virtual

Destructor.

The text is removed from the screen.

Definition at line 74 of file text.cpp.

Member Function Documentation

◆ adviseXY()

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

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

Definition at line 89 of file text.cpp.

◆ draw()

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

Draws the text.

Reimplemented in FlashText.

Definition at line 94 of file text.cpp.

◆ getHeight()

int Text::getHeight ( ) const
inline

Definition at line 54 of file text.h.

◆ getWidth()

int Text::getWidth ( ) const
inline

Definition at line 53 of file text.h.

◆ setColor()

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

Definition at line 84 of file text.cpp.

Friends And Related Symbol Documentation

◆ TextManager

friend class TextManager
friend

Definition at line 35 of file text.h.

Member Data Documentation

◆ mColor

const gcn::Color* Text::mColor
private

The color of the text.

Definition at line 74 of file text.h.

◆ mFont

gcn::Font* Text::mFont
private

The font of the text.

Definition at line 75 of file text.h.

◆ mHeight

int Text::mHeight
private

The height of the text.

Definition at line 70 of file text.h.

◆ mInstances

int Text::mInstances = 0
staticprivate

Instances of text.

Definition at line 72 of file text.h.

◆ mIsSpeech

bool Text::mIsSpeech
private

Is this text a speech bubble?

Definition at line 76 of file text.h.

◆ mText

std::string Text::mText
private

The text to display.

Definition at line 73 of file text.h.

◆ mWidth

int Text::mWidth
private

The width of the text.

Definition at line 69 of file text.h.

◆ mX

int Text::mX
private

Actual x-value of left of text written.

Definition at line 67 of file text.h.

◆ mXOffset

int Text::mXOffset
private

The offset of mX from the desired x.

Definition at line 71 of file text.h.

◆ mY

int Text::mY
private

Actual y-value of top of text written.

Definition at line 68 of file text.h.


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