]> Dogcows Code - chaz/yoink/blobdiff - src/Hud.hh
converted tilemap scripts to lua
[chaz/yoink] / src / Hud.hh
index 8fec549278514ff98814a9799fb09cee494e7450..f386fd4b73731ec12918f260cf13b8624e706221 100644 (file)
  */
 
 #include <Moof/Drawable.hh>
+#include <Moof/Layer.hh>
 #include <Moof/Math.hh>
 #include <Moof/Rectangle.hh>
-#include <Moof/Tilemap.hh>
+
+#include "Tilemap.hh"
 
 
 class ProgressBar : public Mf::Drawable
 {
 public:
 
-       ProgressBar(const Mf::Tilemap& tilemap, Mf::Tilemap::Index index);
+       ProgressBar(const Tilemap& tilemap, Tilemap::Index index);
 
        void resize(const Mf::Rectangle& rect);
 
@@ -59,18 +61,26 @@ private:
        Mf::Vector2     vertices_[8];
        Mf::Scalar      width_;
 
-       Mf::Tilemap     tilemap_;
+       Tilemap         tilemap_;
        Mf::Scalar      texCoords_[8];
        Mf::Scalar      midCoords_[2];
 };
 
 
-class Hud : public Mf::Drawable
+class Hud;
+typedef boost::shared_ptr<Hud> HudP;
+
+class Hud : public Mf::Layer
 {
 public:
 
        Hud();
 
+       static HudP alloc()
+       {
+               return HudP(new Hud);
+       }
+
        void setBar1Progress(Mf::Scalar progress)
        {
                // pass through
@@ -88,6 +98,7 @@ public:
        void resize(int width, int height);
 
        void draw(Mf::Scalar alpha = 0.0) const;
+       bool handleEvent(Mf::Event& event);
 
 private:
 
@@ -95,7 +106,7 @@ private:
        ProgressBar     bar2_;
 
        unsigned        number_;
-       Mf::Tilemap     font_;
+       Tilemap         font_;
 
        Mf::Matrix4     projection_;
 };
This page took 0.017735 seconds and 4 git commands to generate.