派发一个指定事件,并传递需要的参数
event type
Arguments when the event triggered
检查指定事件是否已注册回调。
Event type
Callback function when event triggered
Callback callee
删除之前用同类型,回调,目标或 useCapture 注册的事件监听器,如果只传递 type,将会删除 type 类型的所有事件监听器。
A string representing the event type being removed.
The callback to remove.
The target (this object) to invoke the callback, if it's not given, only callback without target will be removed
The event type
The event listener's callback
The event listener's target and callee
The event type
The event listener's callback
The event listener's target and callee
The event type
The event listener's callback
The event listener's target and callee
The event type
The event listener's callback
The event listener's target and callee
注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。
A string representing the event type to listen for.
The callback that will be invoked when the event is dispatched. The callback is ignored if it is a duplicate (the callbacks are unique).
The target (this object) to invoke the callback, can be null
移除在特定事件类型中注册的所有回调或在某个目标中注册的所有回调。
The event type or target with which the listeners will be removed
是否启用加速度计事件。
设置加速度计间隔值。
在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。
Generated using TypeDoc
系统事件,它目前支持按键事件和重力感应事件。
你可以通过 cc.systemEvent 获取到 SystemEvent 的实例。
cc.systemEvent.on(cc.SystemEvent.EventType.DEVICEMOTION, this.onDeviceMotionEvent, this); cc.systemEvent.off(cc.SystemEvent.EventType.DEVICEMOTION, this.onDeviceMotionEvent, this);