Class GameSound
java.lang.Object
net.risingworld.api.sounds.Sound
net.risingworld.api.sounds.GameSound
Represents a game sound instance, i.e a sound effect of the game which was played for a particular player
(see
One-shot sounds are released automatically once they have finished playing. Loop sounds keep playing until you call
Player.playGameSound(java.lang.String)).One-shot sounds are released automatically once they have finished playing. Loop sounds keep playing until you call
Sound.stop(boolean), or until the player disconnects.- Example: Play a campfire sound as loop, change its volume and stop it later
-
Method Summary
Modifier and TypeMethodDescriptionvoidsetParameter(String name, float value) Sets the value of a sound parameter.voidTriggers the cue of this sound, i.e releases the sustain point of the sound so it continues playing beyond it.Methods inherited from class Sound
equals, getID, getPlayer, getPlayerDbID, hashCode, setDirection, setGameMusicFade, setMinMaxDistance, setPaused, setPitch, setPosition, setTimelinePosition, setVelocity, setVolume, stop
-
Method Details
-
setParameter
Sets the value of a sound parameter. Only certain game sounds have parameters, the available parameters and value ranges depend on the particular sound. Unknown parameters are ignored.- Parameters:
name- the (case sensitive) name of the parameter.value- the new parameter value.
-
triggerCue
public void triggerCue()Triggers the cue of this sound, i.e releases the sustain point of the sound so it continues playing beyond it. Typically sounds which have a distinct start, loop and end part stay in their loop part until the cue is triggered, then they play their end part and stop. Has no effect if the sound has no sustain point.
-