Phaser API Documentation

  Version: 
PAN

Description:

The Sound Pan Event.

This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their pan changes.

Listen to it from a Sound instance using Sound.on('pan', listener), i.e.:

var sound = this.sound.add('key');
sound.on('pan', listener);
sound.play();
sound.setPan(0.5);

Parameters:

name type description
sound Phaser.Sound.WebAudioSound | Phaser.Sound.HTML5AudioSound

A reference to the Sound that emitted the event.

pan number

The new pan of the Sound.

Since: 3.50.0