Skip to content

SoundRichDragListener

Overview

A RichDragListener that supports sounds for grab and release.

@author Jesse Greenberg

Class SoundRichDragListener

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

Constructor

new SoundRichDragListener( providedOptions? : SoundRichDragListenerOptions )

Instance Methods

Static Methods

linkToDragEvents( dragListener : DragListener | KeyboardDragListener, grabSound : TSoundPlayer | null | undefined, releaseSound : TSoundPlayer | null | undefined )

Plays the sounds when the drag listener is pressed or released.

Static Properties

DEFAULT_SOUND_OPTIONS

(readonly)

Type RichDragListenerSoundOptions

Options for drag listeners that are specific to sound.

import type { RichDragListenerSoundOptions } from 'scenerystack/scenery-phet';
  • grabSoundPlayer?: TSoundPlayer | null
    Grab and release sounds. null means no sound.
  • releaseSoundPlayer?: TSoundPlayer | null

Type SoundRichDragListenerOptions

import type { SoundRichDragListenerOptions } from 'scenerystack/scenery-phet';

Source Code

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