Options
All
  • Public
  • Public/Protected
  • All
Menu

Module event

Index

References

EventAcceleration

Re-exports EventAcceleration

EventKeyboard

Re-exports EventKeyboard

EventMouse

Re-exports EventMouse

EventTouch

Re-exports EventTouch

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

Let _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

  • Generate a new class from the given base class, after polyfill all functionalities in IEventified as if it's extended from EventTarget

    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