]>
Dogcows Code - chaz/yoink/blob - Hud.hh
30b5a42be36cae2d195372d6c762399dd59d34c0
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/Layer.hh>
22 #include <Moof/Math.hh>
23 #include <Moof/Rectangle.hh>
24 #include <Moof/Texture.hh>
26 #include "GameState.hh"
29 // TODO this stuff is still just hacked up
31 class ProgressBar
: public Mf::Drawable
35 ProgressBar(const Mf::Texture
& tilemap
, Mf::Texture::TileIndex index
);
37 void resize(const Mf::Rectangle
& rect
);
39 void setProgress(Mf::Scalar progress
);
41 void draw(Mf::Scalar alpha
= 0.0) const;
47 Mf::Vector2 mVertices
[8];
51 Mf::Scalar mTexCoords
[8];
52 Mf::Scalar mMidCoords
[2];
57 typedef boost::shared_ptr
<Hud
> HudP
;
59 class Hud
: public Mf::Layer
63 Hud(GameState
& state
);
65 static HudP
alloc(GameState
& state
)
67 return HudP(new Hud(state
));
70 void setBar1Progress(Mf::Scalar progress
)
73 mBar1
.setProgress(progress
);
76 void setBar2Progress(Mf::Scalar progress
)
79 mBar2
.setProgress(progress
);
82 void setNumber(unsigned value
);
84 void resize(int width
, int height
);
86 void update(Mf::Scalar t
, Mf::Scalar dt
);
87 void draw(Mf::Scalar alpha
= 0.0) const;
88 bool handleEvent(const Mf::Event
& event
);
100 Mf::Matrix4 mProjection
;
This page took 0.034915 seconds and 3 git commands to generate.