X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Finfoblock.hpp;h=21e2ae4c537f3234ecd1839c02da247606fd3ac8;hb=ae7bd4f460fdd93934fc0abc9589758a49309bda;hp=f4be86b6d597e4fdca163581a11a2eb4c2bc5c16;hpb=fd303a198ee56d70136e2da5b894cd122fab1f3c;p=supertux.git diff --git a/src/object/infoblock.hpp b/src/object/infoblock.hpp index f4be86b6d..21e2ae4c5 100644 --- a/src/object/infoblock.hpp +++ b/src/object/infoblock.hpp @@ -1,7 +1,7 @@ // $Id$ -// +// // SuperTux -// Copyright (C) 2005 Matthias Braun +// Copyright (C) 2006 Matthias Braun // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -12,30 +12,41 @@ // 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. +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __INFOBLOCK_H__ #define __INFOBLOCK_H__ #include "block.hpp" //#include "object/ambient_sound.hpp" +#include "textscroller.hpp" class InfoBlock : public Block { public: InfoBlock(const lisp::Lisp& lisp); virtual ~InfoBlock(); - + void update(float elapsed_time); + void draw(DrawingContext& context); + + void show_message(); + void hide_message(); + protected: virtual void hit(Player& player); std::string message; //AmbientSound* ringing; //bool stopped; + float shown_pct; /**< Value in the range of 0..1, depending on how much of the infobox is currently shown */ + float dest_pct; /**< With each call to update(), shown_pct will slowly transition to this value */ + + Player* get_nearest_player(); + + std::vector lines; /**< lines of text (or images) to display */ + float lines_height; }; #endif -