Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UIToggle

Hierarchy

Index

Constructors

constructor

  • new UIToggle(entity: Entity2D): UIToggle

Properties

Readonly entity

entity: Entity2D

物体对象。

Readonly id

id: number = ...

Readonly isDestroyed

isDestroyed: boolean = false

Readonly isDestroying

isDestroying: boolean = false

Readonly priority

priority: number = ...

Optional toggleGroup

toggleGroup: UIToggleGroup

默认值为undefined,UIToggle关联的UIToggleGroup

memberof

UIToggle

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 ToggleState

ToggleState: Readonly<typeof ToggleState> = ...

UIToggle的状态枚举值

static
memberof

UIToggle

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

allowSwitchOff

  • get allowSwitchOff(): boolean
  • set allowSwitchOff(val: boolean): void
  • 是否允许取消激活态

    memberof

    UIToggle

    Returns boolean

  • 是否允许取消激活态

    Parameters

    • val: boolean

    Returns void

index

  • get index(): number
  • set index(val: number): void
  • 位于ToggleGroup的index,若无对应ToggleGroup则为-1

    memberof

    UIToggle

    Returns number

  • 位于ToggleGroup的index,若无对应ToggleGroup则为-1

    Parameters

    • val: number

    Returns void

isChecked

  • get isChecked(): boolean
  • set isChecked(val: boolean): void
  • 是否处于激活态

    memberof

    UIToggle

    Returns boolean

  • 是否处于激活态

    Parameters

    • val: boolean

    Returns void

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 }>>

target

  • get target(): default
  • set target(val: default): void
  • UIToggle激活态影响的渲染组件

    readonly
    memberof

    UIToggle

    Returns default

  • UIToggle激活态影响的渲染组件

    Parameters

    • val: default

    Returns void

Methods

destroy

  • destroy(): void
  • Returns void

getState

  • getState(): ToggleState
  • 返回当前UIToggle状态

    memberof

    UIToggle

    Returns ToggleState

getTypeName

  • getTypeName(): string

isDetached

  • isDetached(): boolean
  • Returns boolean

resetProperties

  • resetProperties(): void

setState

  • setState(state: ToggleState): void
  • 设置UIToggle状态

    memberof

    UIToggle

    Parameters

    • state: ToggleState

    Returns void

Generated using TypeDoc