X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Finfoblock.hpp;h=91ae5baf0a881a227f760b33ed8acfceed7b2d8e;hb=84abfaeb33c5bf8dac0cfd9499d9d4c3e7d39881;hp=78d86f0ddf32579ca8ddfcbee8802bf211174d2a;hpb=5b7f9214cb929399f1a855ef5807018a9447d510;p=supertux.git diff --git a/src/object/infoblock.hpp b/src/object/infoblock.hpp index 78d86f0dd..91ae5baf0 100644 --- a/src/object/infoblock.hpp +++ b/src/object/infoblock.hpp @@ -1,41 +1,50 @@ -// $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 -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. +// 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 3 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. +// along with this program. If not, see . -#ifndef __INFOBLOCK_H__ -#define __INFOBLOCK_H__ +#ifndef HEADER_SUPERTUX_OBJECT_INFOBLOCK_HPP +#define HEADER_SUPERTUX_OBJECT_INFOBLOCK_HPP -#include "block.hpp" -#include "object/ambient_sound.hpp" +#include "object/block.hpp" +#include "supertux/textscroller.hpp" class InfoBlock : public Block { public: - InfoBlock(const lisp::Lisp& lisp); + InfoBlock(const Reader& lisp); virtual ~InfoBlock(); - + void update(float elapsed_time); + void draw(DrawingContext& context); + + void show_message(); + void hide_message(); + protected: virtual void hit(Player& player); + Player* get_nearest_player(); + +protected: std::string message; - AmbientSound* ringing; - bool stopped; + //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 */ + std::vector lines; /**< lines of text (or images) to display */ + float lines_height; }; #endif +/* EOF */