Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Mouse

Hierarchy

Index

Constructors

constructor

Properties

Protected onEvent

onEvent: function | null

Optional _previousIn

_previousIn: undefined | false | true = false

_target

_target: any = null

mask

mask: IListenerMask | null = null

onMouseDown

onMouseDown: Function | null = null

onMouseMove

onMouseMove: Function | null = null

onMouseScroll

onMouseScroll: Function | null = null

onMouseUp

onMouseUp: Function | null = null

owner

owner: Object | null = null

Static ACCELERATION

ACCELERATION: number = 6

加速器事件监听器类型

Static CUSTOM

CUSTOM: number = 8

自定义事件监听器类型

Static KEYBOARD

KEYBOARD: number = 3

键盘事件监听器类型

Static MOUSE

MOUSE: number = 4

鼠标事件监听器类型

Static TOUCH_ALL_AT_ONCE

TOUCH_ALL_AT_ONCE: number = 2

触摸事件监听器类型,触点会被一次性全部派发

Static TOUCH_ONE_BY_ONE

TOUCH_ONE_BY_ONE: number = 1

触摸事件监听器类型,触点会一个一个得分开被派发

Static UNKNOWN

UNKNOWN: number = 0

未知的事件监听器类型

Accessors

onEvent

  • get onEvent(): null | function

Methods

callback

getFixedPriority

  • _getFixedPriority(): number

getListenerID

  • _getListenerID(): string

getSceneGraphPriority

  • _getSceneGraphPriority(): any

getType

  • _getType(): number

isPaused

  • _isPaused(): boolean

Private isRegistered

  • _isRegistered(): boolean

setFixedPriority

  • setFixedPriority(fixedPriority: number): void

setPaused

  • setPaused(paused: boolean): void
  • *为侦听器设置暂停状态
    暂停状态仅用于场景图优先级侦听器。
    EventDispatcher :: resumeAllEventListenersForTarget(node)将暂停状态设置为true
    EventDispatcher :: pauseAllEventListenersForTarget(node)将它设置为false
    注意:

    • 固定优先级侦听器永远不会被暂停。 如果固定优先级不想接收事件,改为调用setEnabled(false)
    • 在“Node”的onEnter和onExit中,监听器的“暂停状态”与该节点关联的*将自动更新。

    Parameters

    • paused: boolean

    Returns void

setRegistered

  • setRegistered(registered: boolean): void

setSceneGraphPriority

  • setSceneGraphPriority(node: any): void

checkAvailable

  • checkAvailable(): boolean

clone

isEnabled

  • isEnabled(): boolean

setEnabled

  • setEnabled(enabled: boolean): void
  • 启用或禁用监听器。
    注意:只有处于“启用”状态的侦听器才能接收事件。
    初始化侦听器时,默认情况下启用它。
    事件侦听器可以在启用且未暂停时接收事件。
    当固定优先级侦听器时,暂停状态始终为false。

    Parameters

    • enabled: boolean

    Returns void

Static create

Object literals

Static ListenerID

ListenerID: object

ACCELERATION

ACCELERATION: string = "__cc_acceleration"

KEYBOARD

KEYBOARD: string = "__cc_keyboard"

MOUSE

MOUSE: string = "__cc_mouse"

TOUCH_ALL_AT_ONCE

TOUCH_ALL_AT_ONCE: string = "__cc_touch_all_at_once"

TOUCH_ONE_BY_ONE

TOUCH_ONE_BY_ONE: string = "__cc_touch_one_by_one"

Generated using TypeDoc