Options
All
  • Public
  • Public/Protected
  • All
Menu

Component for toggle buttons.

Hierarchy

Index

Constructors

constructor

  • Parameters

    • Optional isOn: boolean
    • Optional sprite2DRenderer: Entity
    • Optional transition: Entity
    • Optional transitionChecked: Entity

    Returns Toggle

Properties

isOn

isOn: boolean

True if the toggle is on (for example, checked).

sprite2DRenderer

sprite2DRenderer: Entity

Reference to an entity with a Sprite2DRenderer component that represents the button's toggle's state. Mouse/touch interaction, captured by the MouseInteraction component, swaps or modifies the sprite based on the type of transitions you apply. If this is set to NONE, it assumes that the underlying entity (the one that the Toggle component is attached to) also has a Sprite2DRenderer component, and uses that.

transition

transition: Entity

Reference to an entity that defines visual transitions based on mouse/ touch interaction captured by the MouseInteraction component. For example, A SpriteTransition or ColorTintTransition component. Used when isOn is true.

transitionChecked

transitionChecked: Entity

Reference to an entity that defines visual transitions based on mouse/ touch interaction captured by the MouseInteraction component. For example, A SpriteTransition or ColorTintTransition component. Used when isOn is false.

Static _isSharedComp

_isSharedComp: boolean

Static _size

_size: number

Static _view

_view: any

Static cid

cid: number

Static isOn

Static sprite2DRenderer

sprite2DRenderer: EntityComponentFieldDesc

Static transition

transition: EntityComponentFieldDesc

Static transitionChecked

transitionChecked: EntityComponentFieldDesc

Methods

Static _dtorFn

  • Parameters

    Returns void

Static _fromPtr

  • Parameters

    • p: number
    • Optional v: Toggle

    Returns Toggle

Static _tempHeapPtr

  • _tempHeapPtr(v: Toggle): number
  • Parameters

    Returns number

Static _toPtr

  • _toPtr(p: number, v: Toggle): void
  • Parameters

    Returns void

Generated using TypeDoc