Skip to content

API / IEventDispatcher

接口: IEventDispatcher

定义于: event/IEventDispatcher.ts:43

事件派发接口。 DragonBones 的事件派发通常依赖于对接的引擎来实现,该接口定义了对接引擎时需要实现的事件方法。

继承于

方法

addDBEventListener()

ts
addDBEventListener(
   type: EventStringType, 
   listener: Function, 
   thisObject: any): void;

定义于: event/IEventDispatcher.ts:84

添加特定事件类型的事件侦听器,以使侦听器能够接收事件通知。

参数

参数类型描述
typeEventStringType事件类型。
listenerFunction事件侦听器。
thisObjectany侦听函数绑定的 this 对象。

返回

void


dispatchDBEvent()

ts
dispatchDBEvent(type: EventStringType, eventObject: EventObject): void;

定义于: event/IEventDispatcher.ts:67

分派特定的事件到事件流中。

参数

参数类型描述
typeEventStringType事件类型。
eventObjectEventObject事件数据。

返回

void


hasDBEventListener()

ts
hasDBEventListener(type: EventStringType): boolean;

定义于: event/IEventDispatcher.ts:52

检查是否为特定的事件类型注册了任何侦听器。

参数

参数类型描述
typeEventStringTypeEvent type.

返回

boolean


removeDBEventListener()

ts
removeDBEventListener(
   type: EventStringType, 
   listener: Function, 
   thisObject: any): void;

定义于: event/IEventDispatcher.ts:101

删除特定事件类型的侦听器。

参数

参数类型描述
typeEventStringType事件类型。
listenerFunction事件侦听器。
thisObjectany侦听函数绑定的 this 对象。

返回

void

Released under the MIT License.