]>
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/sprite.hh>
24 #include <moof/view.hh>
26 #include "GameState.hh"
31 // TODO this stuff is still just hacked up
33 class ProgressBar
: public moof::drawable
37 ProgressBar(const moof::sprite
& tilemap
, int index
);
39 void resize(const moof::rectangle
& rect
);
41 void setProgress(moof::scalar progress
);
43 void draw(moof::scalar alpha
= 0.0) const;
47 moof::scalar mProgress
;
49 moof::vector2 mVertices
[8];
52 moof::sprite mTilemap
;
53 moof::scalar mTexCoords
[8];
54 moof::scalar mMidCoords
[2];
59 typedef boost::shared_ptr
<Hud
> HudP
;
61 class Hud
: public moof::view
65 static HudP
alloc(GameState
& state
)
67 return HudP(new Hud(state
));
69 Hud(GameState
& state
);
72 void setBar1Progress(moof::scalar progress
)
75 mBar1
.setProgress(progress
);
78 void setBar2Progress(moof::scalar progress
)
81 mBar2
.setProgress(progress
);
84 void setNumber(unsigned value
);
86 void resize(int width
, int height
);
88 void update(moof::scalar t
, moof::scalar dt
);
89 void draw(moof::scalar alpha
= 0.0) const;
90 bool handle_event(const moof::event
& event
);
102 moof::matrix4 mProjection
;
This page took 0.03709 seconds and 4 git commands to generate.