Oxygine  1
2g game engine
Box9Sprite.h
1 #pragma once
2 #include "oxygine-include.h"
3 #include "Sprite.h"
4 namespace oxygine
5 {
6  DECLARE_SMART(Box9Sprite, spBox9Sprite);
7 
8  class Box9Sprite: public Sprite
9  {
10  INHERITED(Sprite);
11  public:
12  DECLARE_COPYCLONE_NEW(Box9Sprite);
13  enum StretchMode
14  {
15  TILING,
16  TILING_FULL,
17  STRETCHING
18  };
19 
20  Box9Sprite();
21 
22  StretchMode getVerticalMode() const {return _vertMode;}
23  StretchMode getHorizontalMode() const {return _horzMode;}
24 
25  void setVerticalMode(StretchMode m);
26  void setHorizontalMode(StretchMode m);
27 
31  void setGuides(float x1, float x2, float y1, float y2);
32  void setVerticalGuides(float x1, float x2);
33  void setHorizontalGuides(float y1, float y2);
34 
35  bool isOn(const Vector2& localPosition, float localScale) override;
36 
37  std::string dump(const dumpOptions&) const override;
38 
39  void serialize(serializedata* data) override;
40  void deserialize(const deserializedata* data) override;
41 
42  RectF getDestRect() const override;
43 
44  protected:
45  void sizeChanged(const Vector2& size) override;
46  void animFrameChanged(const AnimationFrame& f) override;
47  void changeAnimFrame(const AnimationFrame& f) override;
48 
49  bool _prepared;
50 
51  StretchMode _vertMode;
52  StretchMode _horzMode;
53 
54  float _guideX[2];
55  float _guideY[2];
56 
57  std::vector<float> _guidesX;
58  std::vector<float> _guidesY;
59  std::vector<float> _pointsX;
60  std::vector<float> _pointsY;
61 
62  void prepare();
63 
64  void doRender(const RenderState&) override;
65  };
66 }
67 
68 
69 EDITOR_INCLUDE(Box9Sprite);
Definition: Serialize.h:28
std::string dump(const dumpOptions &) const override
Definition: Box9Sprite.h:8
Definition: Sprite.h:14
Definition: RenderState.h:27
Definition: AnimationFrame.h:28
Definition: Serialize.h:21
bool isOn(const Vector2 &localPosition, float localScale) override
void setGuides(float x1, float x2, float y1, float y2)
–oxgl-end–!
Definition: Actor.h:14