![]() |
ManaPlus
|
#include <text.h>
Public Member Functions | |
| Text (const std::string &text, const int x, const int y, const Graphics::Alignment alignment, const Color *const color, const Speech isSpeech, Font *const font) | |
| virtual | ~Text () |
| void | setColor (const Color *const color) |
| int | getWidth () const |
| int | getHeight () const |
| void | adviseXY (const int x, const int y, const Move move) |
| virtual void | draw (Graphics *const graphics, const int xOff, const int yOff) |
| int | getX () const |
| int | getY () const |
Static Protected Attributes | |
| static ImageRect | mBubble |
Private Attributes | |
| Font * | mFont |
| TextChunk | mTextChunk |
| int | mX |
| int | mY |
| int | mWidth |
| int | mHeight |
| int | mXOffset |
| std::string | mText |
| const Color * | mColor |
| Color | mOutlineColor |
| Speech | mIsSpeech |
| bool | mTextChanged |
Static Private Attributes | |
| static int | mInstances = 0 |
Friends | |
| class | TextManager |
| Text::Text | ( | const std::string & | text, |
| const int | x, | ||
| const int | y, | ||
| const Graphics::Alignment | alignment, | ||
| const Color *const | color, | ||
| const Speech | isSpeech, | ||
| Font *const | font | ||
| ) |
Constructor creates a text object to display on the screen.
Definition at line 46 of file text.cpp.
References TextManager::addText(), Graphics::CENTER, config, Configuration::getFloatValue(), ImageRect::grid, Graphics::LEFT, Theme::loadRect(), mBubble, mInstances, mWidth, mX, mXOffset, Graphics::RIGHT, TextManager, textManager, theme, and x.
|
virtual |
Destructor. The text is removed from the screen.
Definition at line 112 of file text.cpp.
References delete2, ImageRect::grid, mBubble, mInstances, TextManager::removeText(), and textManager.
| void Text::adviseXY | ( | const int | x, |
| const int | y, | ||
| const Move | move | ||
| ) |
Allows the originator of the text to specify the ideal coordinates.
Definition at line 144 of file text.cpp.
References Actions::move(), Move_true, TextManager::moveText(), mX, mXOffset, mY, textManager, x, and y.
Referenced by Being::updateCoords().
|
virtual |
Draws the text.
Reimplemented in FlashText.
Definition at line 158 of file text.cpp.
References BLOCK_END, BLOCK_START, TextChunk::color, TextChunk::color2, TextChunk::deleteImage(), Graphics::drawImage(), Graphics::drawImageRect(), Font::generate(), TextChunk::img, mBubble, mColor, mFont, mHeight, mIsSpeech, mOutlineColor, mText, mTextChanged, mTextChunk, mWidth, mX, mY, Speech_true, TextChunk::text, and TextChunk::textFont.
Referenced by FlashText::draw().
|
inline |
Definition at line 66 of file text.h.
References mHeight.
Referenced by Being::updateBadgesPosition(), and Being::updateCoords().
|
inline |
Definition at line 63 of file text.h.
References mWidth.
Referenced by Being::updateBadgesPosition().
|
inline |
|
inline |
| void Text::setColor | ( | const Color *const | color | ) |
Definition at line 130 of file text.cpp.
References mColor, mIsSpeech, mOutlineColor, mTextChanged, and Speech_true.
Referenced by Being::updateColors().
|
friend |
|
staticprotected |
|
private |
|
private |
|
private |
The height of the text.
Definition at line 94 of file text.h.
Referenced by TextManager::addText(), draw(), getHeight(), TextManager::moveText(), and TextManager::place().
|
staticprivate |
|
private |
Is this text a speech bubble?
Definition at line 100 of file text.h.
Referenced by draw(), and setColor().
|
private |
Definition at line 99 of file text.h.
Referenced by draw(), and setColor().
|
private |
|
private |
Definition at line 101 of file text.h.
Referenced by draw(), and setColor().
|
private |
The width of the text.
Definition at line 93 of file text.h.
Referenced by draw(), getWidth(), TextManager::place(), and Text().
|
private |
Actual x-value of left of text written.
Definition at line 91 of file text.h.
Referenced by TextManager::addText(), adviseXY(), draw(), getX(), TextManager::moveText(), TextManager::place(), and Text().
|
private |
The offset of mX from the desired x.
Definition at line 95 of file text.h.
Referenced by adviseXY(), and Text().
|
private |
Actual y-value of top of text written.
Definition at line 92 of file text.h.
Referenced by TextManager::addText(), adviseXY(), draw(), getY(), TextManager::moveText(), and TextManager::place().