diff options
Diffstat (limited to 'src/text.h')
-rw-r--r-- | src/text.h | 57 |
1 files changed, 33 insertions, 24 deletions
@@ -1,29 +1,31 @@ -/*************************************************************************** - * Copyright (C) 2008 by Douglas Boffey * - * * - * DougABoffey@netscape.net * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ +/* + * Support for non-overlapping floating text + * Copyright (C) 2008 Douglas Boffey <DougABoffey@netscape.net> + * Copyright (C) 2008 The Mana World Development Team + * + * This file is part of The Mana World. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #ifndef TEXT_H #define TEXT_H #include <guichan/color.hpp> -#include <guichan/graphics.hpp> +#include "graphics.h" #include "guichanfwd.h" class TextManager; @@ -37,7 +39,8 @@ class Text * Constructor creates a text object to display on the screen. */ Text(const std::string &text, int x, int y, - gcn::Graphics::Alignment alignment, gcn::Color colour); + gcn::Graphics::Alignment alignment, + gcn::Color colour, bool isSpeech = false); /** * Destructor. The text is removed from the screen. @@ -63,13 +66,19 @@ class Text static int mInstances; /**< Instances of text. */ std::string mText; /**< The text to display. */ gcn::Color mColour; /**< The colour of the text. */ + bool mIsSpeech; /**< Is this text a speech bubble? */ + + protected: + static ImageRect mBubble; /**< Speech bubble graphic */ + static Image *mBubbleArrow; /**< Speech bubble arrow graphic */ }; class FlashText : public Text { public: FlashText(const std::string &text, int x, int y, - gcn::Graphics::Alignment alignment, gcn::Color colour); + gcn::Graphics::Alignment alignment, + gcn::Color colour); /** * Remove the text from the screen @@ -77,12 +86,12 @@ class FlashText : public Text virtual ~FlashText() {} /** - * Flash the text for so many refreshes + * Flash the text for so many refreshes. */ void flash(int time) {mTime = time; } /** - * Draws the text + * Draws the text. */ virtual void draw(gcn::Graphics *graphics, int xOff, int yOff); |