GameObjectFactory#audio()

audio(key, volume, loop, connect) → {Phaser.Sound}

Creates a new Sound object.

Parameters
Name Type Argument Default Description
key string

The Game.cache key of the sound that this object will use.

volume number <optional>
1

The volume at which the sound will be played.

loop boolean <optional>
false

Whether or not the sound will loop.

connect boolean <optional>
true

Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio.

Returns

The newly created sound object.

Source code: gameobjects/GameObjectFactory.js (Line 230)
doc_phaser
2017-02-14 10:48:37
Comments
Leave a Comment

Please login to continue.