My Project
GUIHighlight.h
1 #pragma once
2 #include <map>
3 #include <string>
4 using namespace std;
5 namespace ParaEngine
6 {
7  enum HighlightStyle{
8  HighlightNone,
9  Highlight4outsideArrow,
10  HighlightNstageAnimation,
11  HighlightCustom
12  };
13  class CGUIResource;
14  struct GUIState;
20  class CGUIHighlight:public IObject
21  {
22  public:
30  virtual HRESULT Render(GUIState* pGUIState,RECT& rcScreen, float fElapsedTime )=0;
38  virtual bool SetParameter(const char* szName, const char* szValue)=0;
39 
40  virtual const char* GetHighlightName()const=0;
41  virtual int GetHighlightStyle() const{return m_eStyle;};
42  friend class CGUIHighlightManager;
43  protected:
44  virtual ~CGUIHighlight(){};
45  virtual void Init()=0;
46  bool m_bInit;
47  CGUIResource* m_objResource;
48  int m_eStyle;
49  };
50 
59  {
60  public:
62 
63  virtual bool SetParameter(const char* szName, const char* szValue);
64 
65  virtual HRESULT Render(GUIState* pGUIState,RECT& rcScreen,float fElapsedTime );
66 
67  virtual const char* GetHighlightName()const{return "4outsideArrow";}
68 
69  virtual void Clone(IObject* obj)const;
70  virtual IObject* Clone()const;
71  protected:
72  virtual ~CGUI4OutsideArrow();
73  virtual void Init();
74 
75  float m_fSpeed;//animation speed factor, range [0,1]
76  int m_nRange;//animation range,
77  int m_nPos;//animation position, range [0,m_nRange]
78  int m_nImageSize;// the arrow image size
79  };
80 
86  {
87  public:
89 
90  virtual bool SetParameter(const char* szName, const char* szValue);
91 
92  virtual HRESULT Render(GUIState* pGUIState,RECT& rcScreen,float fElapsedTime );
93 
94  virtual const char* GetHighlightName()const{return "NstageAnimation";}
95 
96  virtual void Clone(IObject* obj)const;
97  virtual IObject* Clone()const;
98  protected:
99  virtual ~CGUINStageAnimation();
100  virtual void Init();
101  int m_nNumStage;
102  int m_nCurStage;//from 1 to n
103  float m_fSpeed;//in seconds
104  float m_fTime;
105  };
111  {
112  public:
119  CGUIHighlight* GetHighlight(int style);
120  CGUIHighlight* GetHighlight(const char* szName);
121 
123  void AddHighlight(int style, CGUIHighlight* pHighlight);
124 
126  void ClearAllInstance();
128  void AddNewInstance(GUIState* pGUIState,RECT& rcScreen,float fElapsedTime, int style);
129 
137  HRESULT Render(GUIState* pGUIState, float fElapsedTime,bool bAutoCleanInstance = true);
138 
141  static HRESULT Render(GUIState* pGUIState,RECT& rcScreen,float fElapsedTime, int style);
142 
143  void Finalize();
144 
149  CGUIHighlight* CreateCustomHighlight(const char* szName, const char* szParentName);
150  protected:
151  map<int,CGUIHighlight*> m_items;
152  map<string, CGUIHighlight*> m_customs;
153 
156  {
157  RECT rcScreen;
158  float fElapsedTime;
159  int style;
160  MarkerInstance(RECT& rcScreen_,float fElapsedTime_, int style_):rcScreen(rcScreen_), fElapsedTime(fElapsedTime_), style(style_){};
161  };
163  list<MarkerInstance> m_instaces;
164  };
165 }
element 0: left arrow element 1: top arrow element 2: right arrow element 3: bottom.
Definition: GUIHighlight.h:58
different physics engine has different winding order.
Definition: EventBinding.h:32
Definition: ManagedDef.h:18
Holds the CGUIHighlight controls.
Definition: GUIHighlight.h:110
base class for object, such as CBaseObject, IAttributeObject, GUI object.
Definition: PERef.h:287
An abstract class "4outsideArrow", 4 arrows pointing from outside to the edge of the control "4inside...
Definition: GUIHighlight.h:20
It&#39;s used as parameter to Render method of each GUI object.
Definition: GUIState.h:16
Each GUI control is associated with a CGUIResource object for rendering.
Definition: GUIResource.h:185
N stage animation element 0—(n-1): the mask of the stages.
Definition: GUIHighlight.h:85
marker instance
Definition: GUIHighlight.h:155
list< MarkerInstance > m_instaces
post render instances
Definition: GUIHighlight.h:163