Package fr.formiko.kokcinelo.tools
Class Musics
java.lang.Object
fr.formiko.kokcinelo.tools.Musics
Tools class to manage music.
It aways play only one music at a time.
It have a null safety for every function.
- Since:
- 0.2
- Version:
- 1.3
-
Method Summary
Modifier and TypeMethodDescriptionstatic voiddispose()Dispose the current music.static floatstatic voidpause()Pause the current music.static voidplay()Play the current music.static voidSet the current music and play it.static voidPlay the menu music.static voidresume()Resume the current music.static voidsetLevelMusic(String levelId) Set a level music.static voidsetLooping(boolean isLooping) Set if the current music is looping.static voidSet the current music.static voidsetVolume(float volume) Set the volume of the current music.static voidstop()Stop the current music.
-
Method Details
-
getMusicsVolume
public static float getMusicsVolume() -
setMusic
Set the current music.- Parameters:
fileName- name of the music file to load from musics/. It must be a mp3 file.
-
play
public static void play()Play the current music. -
resume
public static void resume()Resume the current music. -
play
Set the current music and play it.- Parameters:
fileName- name of the music file to load from musics/. It must be a mp3 file.
-
pause
public static void pause()Pause the current music. -
stop
public static void stop()Stop the current music. -
dispose
public static void dispose()Dispose the current music. -
setVolume
public static void setVolume(float volume) Set the volume of the current music.- Parameters:
volume- volume of the music. It must be between 0 and 1.
-
setLooping
public static void setLooping(boolean isLooping) Set if the current music is looping.- Parameters:
isLooping- true if the music is looping.
-
playMenuMusic
public static void playMenuMusic()Play the menu music. -
setLevelMusic
Set a level music.- Parameters:
levelId- id of the level
-