-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
event-enum.ts
205 lines (181 loc) · 5.22 KB
/
event-enum.ts
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
/**
* @category event
*/
import { ccenum } from '../../value-types/enum';
/**
* @zh
* 一般用于系统事件或者节点事件的事件枚举
*/
export enum SystemEventType {
/**
* @en
* The event type for touch start event, you can use its value directly: 'touchstart'.
*
* @zh
* 手指开始触摸事件。
*/
TOUCH_START = 'touch-start',
/**
* @en
* The event type for touch move event, you can use its value directly: 'touchmove'.
*
* @zh
* 当手指在屏幕上移动时。
*/
TOUCH_MOVE = 'touch-move',
/**
* @en
* The event type for touch end event, you can use its value directly: 'touchend'.
*
* @zh
* 手指结束触摸事件。
*/
TOUCH_END = 'touch-end',
/**
* @en
* The event type for touch end event, you can use its value directly: 'touchcancel'.
*
* @zh
* 当手指在目标节点区域外离开屏幕时。
*/
TOUCH_CANCEL = 'touch-cancel',
/**
* @en
* The event type for mouse down events, you can use its value directly: 'mousedown'.
*
* @zh
* 当鼠标按下时触发一次。
*/
MOUSE_DOWN = 'mouse-down',
/**
* @en
* The event type for mouse move events, you can use its value directly: 'mousemove'.
*
* @zh
* 当鼠标在目标节点在目标节点区域中移动时,不论是否按下。
*/
MOUSE_MOVE = 'mouse-move',
/**
* @en
* The event type for mouse up events, you can use its value directly: 'mouseup'.
*
* @zh
* 当鼠标从按下状态松开时触发一次。
*/
MOUSE_UP = 'mouse-up',
/**
* @en
* The event type for mouse wheel events, you can use its value directly: 'mousewheel'.
*
* @zh 手指开始触摸事件
*/
MOUSE_WHEEL = 'mouse-wheel',
/**
* @en
* The event type for mouse leave target events, you can use its value directly: 'mouseleave'.
*
* @zh
* 当鼠标移入目标节点区域时,不论是否按下.
*/
MOUSE_ENTER = 'mouse-enter',
/**
* @en
* The event type for mouse leave target events, you can use its value directly: 'mouseleave'.
*
* @zh
* 当鼠标移出目标节点区域时,不论是否按下。
*/
MOUSE_LEAVE = 'mouse-leave',
/**
* @en The event type for press the key down event, you can use its value directly: 'keydown'
* @zh 当按下按键时触发的事件
*/
KEY_DOWN = 'keydown',
/**
* @en The event type for press the key up event, you can use its value directly: 'keyup'
* @zh 当松开按键时触发的事件
*/
KEY_UP = 'keyup',
/**
* @en
* The event type for press the devicemotion event, you can use its value directly: 'devicemotion'
*
* @zh
* 重力感应
*/
DEVICEMOTION = 'devicemotion',
/**
* @en
* The event type for position, rotation, scale changed.
*
* @zh
* 节点改变位置、旋转或缩放事件.
*/
TRANSFORM_CHANGED = 'transform-changed',
/**
* @en
* The event type for position changed.
*
* @zh
* 节点位置改变事件
*/
POSITION_PART = 'position-part',
/**
* @en
* The event type for rotation changed.
*
* @zh
* 节点旋转事件
*/
ROTATION_PART = 'rotation-part',
/**
* @en The event type for scale changed.
* @zh 节点缩放事件
*/
SCALE_PART = 'scale-part',
/**
* @en The event type for press the devicemotion event, you can use its value directly: 'devicemotion'.
* @zh
*/
SCENE_CHANGED_FOR_PERSISTS = 'scene-changed-for-persists',
/**
* @en
* The event type for size change events.
* Performance note, this event will be triggered every time corresponding properties being changed,
* if the event callback have heavy logic it may have great performance impact, try to avoid such scenario.
*
* @zh
* 当节点尺寸改变时触发的事件。
* 性能警告:这个事件会在每次对应的属性被修改时触发,如果事件回调损耗较高,有可能对性能有很大的负面影响,请尽量避免这种情况。
*/
SIZE_CHANGED = 'size-changed',
/**
* @en
* The event type for anchor point change events.
* Performance note, this event will be triggered every time corresponding properties being changed,
* if the event callback have heavy logic it may have great performance impact, try to avoid such scenario.
*
* @zh
* 当节点锚点改变时触发的事件。
* 性能警告:这个事件会在每次对应的属性被修改时触发,如果事件回调损耗较高,有可能对性能有很大的负面影响,请尽量避免这种情况。
*/
ANCHOR_CHANGED = 'anchor-changed',
/**
* @en
* The event type for add children.
*
* @zh
* 节点子类添加。
*/
CHILD_ADDED = 'child-added',
/**
* @en
* The event type for removed children.
*
* @zh
* 节点子类移除。
*/
CHILD_REMOVED = 'child-removed',
}
ccenum(SystemEventType);
cc.SystemEventType = SystemEventType;