forked from chenzhi/CameraGame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UIManager.h
77 lines (41 loc) · 1.23 KB
/
UIManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//
// UIManager.h
// ogreApp
//
// Created by thcz on 11-7-7.
// Copyright 2011年 __MyCompanyName__. All rights reserved.
//
/****************************************************************
管理ui界面
************************************************************/
#pragma once
class UIBase;
typedef std::vector<UIBase*> UICollect;
class UIManager
{
public:
UIManager();
~UIManager();
/**注册一个ui,成功返回真,失败返回假*/
bool registerUI(UIBase* pUI);
/**注销一个ui,不销毁*/
bool unregisterUI(UIBase* pUI);
/**通过名字获取一个ui,无返回空*/
UIBase* getUIByName(const std::string& name)const ;
/**每帧更新*/
void update(float time);
/**消毁一个ui*/
void destroyUI(UIBase* pUI);
void destroyUI(const std::string& name);
/**销毁所有的ui*/
void destroyAllUI();
///@{输入事件,
void TouchBegan(int x,int y);
/**手指离开*/
void TouchEnd(int x,int y);
/**手指滑动*/
void TouchMove(int x,int y);
///@}输入事件结束,
protected:
UICollect m_UICollect;
};