]>
Dogcows Code - chaz/yoink/blob - src/Hud.hh
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
10 **************************************************************************/
20 #include <Moof/Drawable.hh>
21 #include <Moof/Math.hh>
22 //#include <Moof/Rectangle.hh>
23 #include <Moof/Texture.hh>
24 #include <Moof/View.hh>
26 #include "GameState.hh"
31 // TODO this stuff is still just hacked up
33 class ProgressBar
: public Mf::Drawable
37 ProgressBar(const Mf::Texture
& tilemap
, Mf::Texture::TileIndex index
);
39 void resize(const Mf::Rectangle
& rect
);
41 void setProgress(Mf::Scalar progress
);
43 void draw(Mf::Scalar alpha
= 0.0) const;
49 Mf::Vector2 mVertices
[8];
53 Mf::Scalar mTexCoords
[8];
54 Mf::Scalar mMidCoords
[2];
59 typedef boost::shared_ptr
<Hud
> HudP
;
61 class Hud
: public Mf::View
65 static HudP
alloc(GameState
& state
)
67 return HudP(new Hud(state
));
69 Hud(GameState
& state
);
72 void setBar1Progress(Mf::Scalar progress
)
75 mBar1
.setProgress(progress
);
78 void setBar2Progress(Mf::Scalar progress
)
81 mBar2
.setProgress(progress
);
84 void setNumber(unsigned value
);
86 void resize(int width
, int height
);
88 void update(Mf::Scalar t
, Mf::Scalar dt
);
89 void draw(Mf::Scalar alpha
= 0.0) const;
90 bool handleEvent(const Mf::Event
& event
);
102 Mf::Matrix4 mProjection
;
This page took 0.041937 seconds and 4 git commands to generate.