Oxygine  1
2g game engine
ProgressBar.h
1 #pragma once
2 #include "oxygine-include.h"
3 #include "Sprite.h"
4 
5 namespace oxygine
6 {
7  DECLARE_SMART(ProgressBar, spProgressBar);
8 
9  class ProgressBar: public Sprite
10  {
11  INHERITED(Sprite);
12  public:
13  enum { PROGRESS_CHANGED = sysEventID('P', 'C', 'h') };
14 
15  enum direction
16  {
17  dir_0,//moveable right edge
18  dir_90,//moveable top edge
19  dir_180,//moveable left edge
20  dir_270,//moveable bottom edge
21  dir_radial_cw,
22  __dir_radial_ccw//not implemented!!
23  };
24 
25  DECLARE_COPYCLONE_NEW(ProgressBar);
26 
27  ProgressBar();
28  ~ProgressBar();
29 
30  float getProgress() const;
31  direction getDirection() const;
32 
36  void setProgress(float value);
37  void setDirection(direction dir);
38 
39  std::string dump(const dumpOptions&) const override;
40 
41  void serialize(serializedata* data) override;
42  void deserialize(const deserializedata* data) override;
43 
45 
46  private:
47  void doRender(const RenderState&) override;
48 
49  virtual void _update();
50 
51  void animFrameChanged(const AnimationFrame& f) override;
52 
53  float _progress;
54  direction _direction;
55  AnimationFrame _originalFrame;
56  };
57 }
58 
59 EDITOR_INCLUDE(ProgressBar);
Definition: Serialize.h:28
Definition: Sprite.h:14
Definition: Property.h:73
Definition: RenderState.h:27
Definition: AnimationFrame.h:28
Definition: Serialize.h:21
Definition: ProgressBar.h:9
–oxgl-end–!
Definition: Actor.h:14
void setProgress(float value)
std::string dump(const dumpOptions &) const override