Oxygine  1
2g game engine
VisualStyle.h
1 #pragma once
2 #include "oxygine-include.h"
3 #include "Actor.h"
4 
5 namespace oxygine
6 {
7  class VisualStyle
8  {
9  public:
10 
11  VisualStyle();
12 
13  const Color& getColor() const {return _color;}
14  blend_mode getBlendMode() const {return _blend;}
15 
16  void setColor(const Color& color);
17  void setBlendMode(blend_mode mode);
18 
19  std::string dump() const;
20 
21 
22 
23  protected:
24  Color _color;
25  blend_mode _blend;
26  };
27 
28  DECLARE_SMART(VStyleActor, spVStyleActor);
29  class VStyleActor : public Actor
30  {
31  INHERITED(Actor);
32  public:
33  DECLARE_COPYCLONE_NEW(VStyleActor);
34  VStyleActor();
35 
36  void serialize(serializedata* data) override;
37  void deserialize(const deserializedata* data) override;
38 
39  blend_mode getBlendMode() const {return _vstyle.getBlendMode();}
40  const Color& getColor() const;
41 
42  void setColor(const Color& color);
43  void setColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
44  void setBlendMode(blend_mode mode) {_vstyle.setBlendMode(mode);}
45 
47 
48  bool getBounds(RectF& b) const override { b = getDestRect(); return true; }
49 
50  protected:
51  VisualStyle _vstyle;
52  };
53 
54 }
55 
56 EDITOR_INCLUDE(VStyleActor);
Definition: Serialize.h:28
Definition: Actor.h:42
Definition: Property.h:73
Definition: Serialize.h:21
–oxgl-end–!
Definition: Actor.h:14
Definition: VisualStyle.h:7
Definition: VisualStyle.h:29
Definition: Color.h:8