Scroll nonblocking infoblock by moving half a block away.
[supertux.git] / src / object / infoblock.hpp
index 78d86f0..f67b81a 100644 (file)
@@ -1,7 +1,7 @@
 //  $Id$
-// 
+//
 //  SuperTux
-//  Copyright (C) 2005 Matthias Braun <matze@braunis.de>
+//  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
 //  This program is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU General Public License
 //  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 "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;
+  //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::auto_ptr<InfoBox> infoBox;
+
+  Player* get_nearest_player();
+
+private:
+  float slowdown_scroll;
 };
 
 #endif
-