Button#setSounds()

setSounds(overSound, overMarker, downSound, downMarker, outSound, outMarker, upSound, upMarker)

Sets the sounds to be played whenever this Button is interacted with. Sounds can be either full Sound objects, or markers pointing to a section of a Sound object.
The most common forms of sounds are 'hover' effects and 'click' effects, which is why the order of the parameters is overSound then downSound.

Call this function with no parameters to reset all sounds on this Button.

Parameters
Name Type Argument Description
overSound Phaser.Sound | Phaser.AudioSprite <optional>

Over Button Sound.

overMarker string <optional>

Over Button Sound Marker.

downSound Phaser.Sound | Phaser.AudioSprite <optional>

Down Button Sound.

downMarker string <optional>

Down Button Sound Marker.

outSound Phaser.Sound | Phaser.AudioSprite <optional>

Out Button Sound.

outMarker string <optional>

Out Button Sound Marker.

upSound Phaser.Sound | Phaser.AudioSprite <optional>

Up Button Sound.

upMarker string <optional>

Up Button Sound Marker.

Source code: gameobjects/Button.js (Line 396)
doc_phaser
2017-02-14 10:39:40
Comments
Leave a Comment

Please login to continue.