]>
Dogcows Code - chaz/yoink/blob - src/Hud.hh
2 /*] Copyright (c) 2009-2011, Charles McGarvey [*****************************
3 **] All rights reserved.
5 * Distributable under the terms and conditions of the 2-clause BSD license;
6 * see the file COPYING for a complete text of the license.
8 *****************************************************************************/
13 #include <moof/drawable.hh>
14 #include <moof/math.hh>
15 //#include <moof/rectangle.hh>
16 #include <moof/sprite.hh>
18 #include "GameState.hh"
27 // forward declarations
30 // TODO this stuff is still just hacked up
32 class ProgressBar
: public moof::drawable
36 ProgressBar(const moof::sprite
& tilemap
, int index
);
38 void resize(const moof::rectangle
& rect
);
40 void setProgress(moof::scalar progress
);
42 void draw(moof::scalar alpha
= 0.0) const;
46 moof::scalar mProgress
;
48 moof::vector2 mVertices
[8];
51 moof::sprite mTilemap
;
52 moof::scalar mTexCoords
[8];
53 moof::scalar mMidCoords
[2];
58 typedef boost::shared_ptr
<Hud
> HudP
;
64 static HudP
alloc(GameState
& state
)
66 return HudP(new Hud(state
));
68 Hud(GameState
& state
);
71 void setBar1Progress(moof::scalar progress
)
74 mBar1
.setProgress(progress
);
77 void setBar2Progress(moof::scalar progress
)
80 mBar2
.setProgress(progress
);
83 void setNumber(unsigned value
);
85 void resize(int width
, int height
);
87 void update(moof::scalar t
, moof::scalar dt
);
88 void draw(moof::scalar alpha
= 0.0) const;
89 bool handle_event(const moof::event
& event
);
101 moof::matrix4 mProjection
;
This page took 0.04015 seconds and 5 git commands to generate.