Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TouchInputComponent

2D点击组件,负责点击判定和事件分发。

export

Hierarchy

Index

Constructors

constructor

Properties

clickMovementThreshold

clickMovementThreshold: number = ...

点击判定的移动阈值,超出阈值则不视为点击事件。

memberof

TouchInputComponent

Readonly entity

entity: Entity2D

物体对象。

memberof

Touchable

hitArea

hitArea: Rect = null

点击判定区域。

memberof

TouchInputComponent

Readonly id

id: number = ...

Readonly isDestroyed

isDestroyed: boolean = false

Readonly isDestroying

isDestroying: boolean = false

Readonly priority

priority: number = ...

touchThrough

touchThrough: boolean = false

是否允许事件穿透。

memberof

TouchInputComponent

Static Priority

Priority: { Align: number; Layout: number; Low: number; Physics: number; Render: number; Tool: number } = ...

Type declaration

  • Align: number
  • Layout: number
  • Low: number
  • Physics: number
  • Render: number
  • Tool: number

Static Optional Serialize

Serialize: (...args: any[]) => any

Type declaration

    • (...args: any[]): any
    • Parameters

      • Rest ...args: any[]

      Returns any

Static TOUCH_EVENTS

TOUCH_EVENTS: typeof TouchEventNames = ...

触摸事件类型枚举值。

static
memberof

TouchInputComponent

Accessors

active

  • get active(): boolean
  • set active(value: boolean): void
  • Returns boolean

  • Parameters

    • value: boolean

    Returns void

activeInHierarchy

  • get activeInHierarchy(): boolean
  • 在场景树中是否active

    readonly
    memberof

    Component

    Returns boolean

onClick

  • get onClick(): Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>
  • 点击事件,只有触发过触摸开始事件才可能触发。

    readonly
    memberof

    Touchable

    Returns Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>

onTouchCancel

  • get onTouchCancel(): Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>
  • 触摸取消事件,只有触发过触摸开始事件才可能触发。

    readonly
    memberof

    Touchable

    Returns Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>

onTouchEnd

  • get onTouchEnd(): Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>
  • 触摸结束事件,只有触发过触摸开始事件才可能触发。

    readonly
    memberof

    Touchable

    Returns Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>

onTouchEnter

  • get onTouchEnter(): Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>
  • 触摸进入事件,只有触发过触摸开始事件才可能触发。

    readonly
    memberof

    Touchable

    Returns Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>

onTouchLeave

  • get onTouchLeave(): Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>
  • 触摸离开事件,只有触发过触摸开始事件才可能触发。

    readonly
    memberof

    Touchable

    Returns Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>

onTouchMove

  • get onTouchMove(): Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>
  • 触摸移动事件,只有触发过触摸开始事件才可能触发。

    readonly
    memberof

    Touchable

    Returns Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>

onTouchOut

  • get onTouchOut(): Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>
  • 触摸掠过后移出事件,没有触发过触摸开始事件才能触发。

    readonly
    memberof

    Touchable

    Returns Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>

onTouchOver

  • get onTouchOver(): Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>
  • 触摸掠过事件,没有触发过触摸开始事件才能触发。

    readonly
    memberof

    Touchable

    Returns Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>

onTouchStart

  • get onTouchStart(): Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>
  • 触摸开始事件。

    readonly
    memberof

    Touchable

    Returns Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>

onTouchUp

  • get onTouchUp(): Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>
  • 触摸掠过后移出事件,没有触发过触摸开始事件才能触发。

    readonly
    memberof

    Touchable

    Returns Delegate<this, Readonly<{ allowThrough: boolean; originalEvent: TouchEvent; touches: DeepImmutableArray<TouchPoint>; type: TouchEventNames; stopTouchThrough: any }>>

Methods

destroy

  • destroy(): void
  • Returns void

getTypeName

  • getTypeName(): string

isDetached

  • isDetached(): boolean
  • Returns boolean

resetProperties

  • resetProperties(): void

Generated using TypeDoc