diff options
Diffstat (limited to 'src/text.h')
-rw-r--r-- | src/text.h | 45 |
1 files changed, 21 insertions, 24 deletions
@@ -31,43 +31,41 @@ class TextManager; class Text { - friend class TextManager; + friend class TextManager; + public: /** - * Constructor creates a text object to display on the screen + * Constructor creates a text object to display on the screen. */ Text(const std::string &text, int x, int y, gcn::Graphics::Alignment alignment, gcn::Font *font, gcn::Color colour); /** - * Allows the originator of the text to specify the ideal coordinates + * Destructor. The text is removed from the screen. */ - void - adviseXY(int x, int y); + virtual ~Text(); /** - * Remove the text from the screen + * Allows the originator of the text to specify the ideal coordinates. */ - virtual ~Text(); + void adviseXY(int x, int y); /** - * Draws the text + * Draws the text. */ - virtual void - draw(Graphics *graphics, int xOff, int yOff); - - protected: + virtual void draw(Graphics *graphics, int xOff, int yOff); - 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 */ - static int mInstances; /**< Instances of text */ - gcn::Font *mFont; /**< The font used */ - std::string mText; /**< The text to display */ - gcn::Color mColour; /**< The colour of the text */ + private: + 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. */ + static int mInstances; /**< Instances of text. */ + gcn::Font *mFont; /**< The font used. */ + std::string mText; /**< The text to display. */ + gcn::Color mColour; /**< The colour of the text. */ }; class FlashText : public Text @@ -90,10 +88,9 @@ class FlashText : public Text /** * Draws the text */ - virtual void - draw(Graphics *graphics, int xOff, int yOff); + virtual void draw(Graphics *graphics, int xOff, int yOff); private: - int mTime; /**< Time left for flashing */ + int mTime; /**< Time left for flashing */ }; #endif |