Skip to content

PlayControlButton

Overview

A round toggle button that displays some custom icon when playing and a triangular "Play" icon when not playing.

@author Sam Reid (PhET Interactive Simulations) @author Jesse Greenberg (PhET Interactive Simulations)

Class PlayControlButton

import { PlayControlButton } from 'scenerystack/scenery-phet';

Constructor

new PlayControlButton( isPlayingProperty : Property<boolean>, endPlayingIcon : Node, providedOptions? : PlayControlButtonOptions )

Instance Methods

dispose()

Static Properties

TOGGLE_PLAY_HOTKEY_DATA : HotkeyData

(readonly)

Type PlayControlButtonOptions

import type { PlayControlButtonOptions } from 'scenerystack/scenery-phet';
  • radius?: number
  • scaleFactorWhenNotPlaying?: number
    {Scale factor applied to the button when the "Play" button is shown (isPlayingProperty is false). PhET convention is to increase the size of the "Play" button when interaction with the sim does NOT unpause the sim.
  • includeGlobalHotkey?: boolean
    pdom: If true, listener is added to toggle isPlayingProperty with key command "alt + k" regardless of where focus is in the document. Only if the sim supports Interactive Description.
  • startPlayingLabel?: PDOMValueType
    Label for the button in the PDOM when the button will set isPlayingProperty to true
  • endPlayingLabel?: PDOMValueType | null
    Label for the button in the PDOM when the button will set isPlayingProperty to false
  • valueOffSoundPlayer?: TSoundPlayer
    sound generation
  • valueOnSoundPlayer?: TSoundPlayer
  • & BooleanRoundToggleButtonOptions

Source Code

See the source for PlayControlButton.ts in the scenery-phet repository.