Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Button

Buttons can be pushed by participants with their mouse or activated with their keyboards.

Hierarchy

Implements

Index

Constructors

constructor

Properties

accentColor

accentColor: string

The color of the cooldown spinner and progress bar on the button. Set this value using setAccentColor

backgroundColor

backgroundColor: string

The color of the background of the button. Set this value using setBackgroundColor

borderColor

borderColor: string

The color of the border on the button. Set this value using setBorderColor

client

client: IClient

controlID

controlID: string

cooldown

cooldown: number

If set this value is the Unix Timestamp at which this button's cooldown will expire. Set this value using setCooldown

cost

cost: number

The spark cost of this button in sparks. Set this value using setCost

disabled

disabled: boolean

etag

etag: string
deprecated

etags are no longer used, you can always omit/ignore this

focusColor

focusColor: string

The color around the border of the button when in focus. Set this value using setFocusColor

keyCode

keyCode: number

A keycode which will trigger this button if pressed on a participant's keyboard.

kind

kind: string

meta

meta: IMeta

position

position: IGridPlacement[]

progress

progress: number

A decimalized percentage (0.0 - 1.0) which controls how wide this button's progress bar is.

Set this value using setProgress

Protected scene

scene: Scene

text

text: string

The text displayed on a button, presented to the participants. Set this value using setText

textColor

textColor: string

The color of the text displayed on the button. Set this value using setTextColor

textSize

textSize: string

The size of the text displayed on the button. Set this value using setTextSize

tooltip

tooltip: string

The tooltip text displayed when the participant hovers over the button. Set this value using setTooltip

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addListener

  • addListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

destroy

  • destroy(): void

disable

  • disable(): Promise<void>

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

enable

  • enable(): Promise<void>

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

getMaxListeners

  • getMaxListeners(): number
  • Returns number

giveInput

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

on

  • on(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

onUpdate

once

  • once(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

receiveInput

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

Protected sendInput

  • sendInput<K>(input: K): Promise<void>

setAccentColor

  • setAccentColor(accentColor: string): Promise<void>

setBackgroundColor

  • setBackgroundColor(backgroundColor: string): Promise<void>

setBorderColor

  • setBorderColor(borderColor: string): Promise<void>

setClient

setCooldown

  • setCooldown(duration: number): Promise<void>
  • Sets the cooldown for this button. Specified in Milliseconds. The Client will convert this to a Unix timestamp for you.

    Parameters

    • duration: number

    Returns Promise<void>

setCost

  • setCost(cost: number): Promise<void>

setFocusColor

  • setFocusColor(focusColor: string): Promise<void>

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

setProgress

  • setProgress(progress: number): Promise<void>

setScene

  • setScene(scene: Scene): void

setText

  • setText(text: string): Promise<void>

setTextColor

  • setTextColor(textColor: string): Promise<void>

setTextSize

  • setTextSize(textSize: string): Promise<void>

setTooltip

  • setTooltip(tooltip: string): Promise<void>

update

Protected updateAttribute

  • updateAttribute<K>(attribute: K, value: T[K]): Promise<void>

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc