Class Musics

java.lang.Object
fr.formiko.kokcinelo.tools.Musics

public class Musics extends Object
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 Details

    • getMusicsVolume

      public static float getMusicsVolume()
    • setMusic

      public static void setMusic(String fileName)
      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

      public static void play(String fileName)
      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

      public static void setLevelMusic(String levelId)
      Set a level music.
      Parameters:
      levelId - id of the level