Methods
-
add_sound(tag, volume, looping)
-
Returns a new sound object.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description tagString the tag of the sound to add
volumeNumber volume to play the sound at
loopingBoolean whether or not to loop the sound when it's played
Code Equivalent:
game.add.audio(tag, volume, looping) -
get_sound_boolean_member(object, element)
-
Returns the chosen boolean field value of the sound.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description objectobject to get values from
elementthe element to get values of
Code Equivalent:
undefined -
get_sound_numeric_member(object, element)
-
Returns the chosen numeric field value of the sound.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description objectobject to get values from
elementthe element to get values of
Code Equivalent:
undefined -
get_sound_string_member(object, element)
-
Returns the chosen string field value of the sound.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description objectobject to get values from
elementthe element to get values of
Code Equivalent:
undefined -
load_sound(tag, source)
-
Creates a sound with the given tag by loading it into the audio queue.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description tagString tag to name the sound
sourceString file path of the sound
Code Equivalent:
game.load.audio(tag, source); -
set_sound_boolean_member(element, object, value)
-
Assigns the chosen boolean field for the sound.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description elementthe field to set
objectsound to assign values for
valuevalue to set the field to
Code Equivalent:
undefined -
set_sound_numeric_member(element, object, value)
-
Assigns the chosen numeric field for the sound.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description elementthe field to set
objectsound to assign values for
valuevalue to set the field to
Code Equivalent:
undefined -
sound_fade_in(sound_object, duration, loop)
-
Starts playing the sound at a volume of 0, and reaches the maximum volume for the sound over the given time, with the option to loop.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description sound_objectsound to play
durationNumber the time it takes for the sound to reach maximum volume
loopBoolean whether or not the sound should loop
Code Equivalent:
sound_object.fadeIn(duration, loop); -
sound_fade_out(sound_object, duration)
-
Makes the sound go from it's current volume to a volume of 0 over the given time.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description sound_objectsound to stop
durationNumber the time it takes for the sound to reach 0
Code Equivalent:
sound_object.fadeOut(duration); -
sound_fade_to(sound_object, duration, volume)
-
Makes the sound go from it's current volume to the given volume over the given time.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description sound_objectsound to change
durationNumber the time it takes for the sound to reach the new volume
volumeNumber the volume to change the sound to
Code Equivalent:
sound_object.fadeTo(duration, volume); -
sound_loop_full(sound_object, volume)
-
Loops the entire sound at the given volume.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description sound_objectsound to loop
volumeNumber volume to play the sound at
Code Equivalent:
sound_object.loopFull(volume); -
sound_pause(sound_object)
-
Parameters:
Name Type Description sound_objectsound to pause
Code Equivalent:
sound_object.pause(); -
sound_play(sound_object, position, volume, loop, restart)
-
Play the sound with the given properties.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description sound_objectsound to play
positionNumber position to play the sound from
volumeNumber volume to play the sound at
loopBoolean whether or not the sound should loop
restartBoolean option to force the sound to restart from the beginning
Code Equivalent:
sound_object.play('', position, volume, loop, restart); -
sound_restart(sound_object, position, volume, loop)
-
Restarts the sound with the given properties.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description sound_objectsound to restart
positionNumber the starting position to play the sound from
volumeNumber the volume to play the sound at
loopBoolean whether or not the sound should loop
Code Equivalent:
sound_object.play('', position, volume, loop); -
sound_resume(sound_object)
-
Resume the sound.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description sound_objectsound to resume
Code Equivalent:
sound_object.resume(); -
sound_stop(sound_object)
-
Stop the sound playing.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description sound_objectsound to stop
Code Equivalent:
sound_object.stop(); -
stop_pause_resume_sounds(option)
-
Stop, pause, or remove all sounds in the game.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description optionwhich option to do
Code Equivalent:
game.sound.optionAll();