Options
All
  • Public
  • Public/Protected
  • All
Menu

Module event

Index

References

Event

Re-exports Event

EventAcceleration

Re-exports EventAcceleration

EventKeyboard

Re-exports EventKeyboard

EventMouse

Re-exports EventMouse

EventTarget

Re-exports EventTarget

EventTouch

Re-exports EventTouch

Eventify

Re-exports Eventify

SystemEvent

Re-exports SystemEvent

SystemEventType

Re-exports SystemEventType

Touch

Re-exports Touch

systemEvent

Re-exports systemEvent

Type aliases

Constructor

Constructor<T>: {}

Type parameters

  • T

Type declaration

EventTarget

EventTarget: InstanceType<typeof EventTarget>

EventType

EventType: string

Variables

Const BlockEvents

BlockEvents: SystemEventType[] = [SystemEventType.TOUCH_START, SystemEventType.TOUCH_END, SystemEventType.TOUCH_MOVE,SystemEventType.MOUSE_DOWN, SystemEventType.MOUSE_MOVE, SystemEventType.MOUSE_UP,SystemEventType.MOUSE_ENTER, SystemEventType.MOUSE_LEAVE, SystemEventType.MOUSE_WHEEL]

Const EventTarget

EventTarget: {} = Eventify(Empty)
en

EventTarget is an object to which an event is dispatched when something has occurred. Nodes are the most common event targets, but other objects can be event targets too. If a class cannot extend from EventTarget, it can consider using Eventify.

zh

事件目标是具有注册监听器、派发事件能力的类,Node 是最常见的事件目标, 但是其他类也可以继承自事件目标以获得管理监听器和派发事件的能力。 如果无法继承自 EventTarget,也可以使用 Eventify

Type declaration

Const _vec2

_vec2: Vec2 = new Vec2()

Const _vec2

_vec2: Vec2 = new Vec2()

Let accelerationListener

accelerationListener: EventListener | null = null

Let keyboardListener

keyboardListener: EventListener | null = null

Let mouseListener

mouseListener: EventListener | null = null

Const systemEvent

systemEvent: SystemEvent = new SystemEvent()
en

The singleton of the SystemEvent, there should only be one instance to be used globally

zh

系统事件单例,方便全局使用。

Let touchListener

touchListener: EventListener | null = null

Functions

Eventify

  • 生成一个类,该类继承自指定的基类,并以和 EventTarget 等同的方式实现了 [[IEventified]] 的所有接口。

    example
    class Base { say() { console.log('Hello!'); } }
    class MyClass extends Eventify(Base) { }
    function (o: MyClass) {
        o.say(); // Ok: Extend from `Base`
        o.emit('sing', 'The ghost'); // Ok: `MyClass` implements IEventified
    }

    Type parameters

    • TBase

    Parameters

    Returns Constructor<TBase & IEventified>

stopPropagation

  • stopPropagation(event: Event): void

Generated using TypeDoc