public class MusicPlayer extends Object implements Disposable
| Modifier and Type | Field and Description |
|---|---|
protected Music |
s |
protected float |
volume |
| Constructor and Description |
|---|
MusicPlayer(String file)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Release resources when done working with them
|
protected void |
finalize()
Called when the object is destroyed
|
boolean |
isLooping() |
boolean |
isPlaying() |
void |
loop()
Plays the song in loop, repeating forever
|
void |
play()
Starts playing the song
|
void |
setVolume(float v)
Changes volume of the song played
|
void |
stop()
Stops playing the song
|
protected Music s
protected float volume
public MusicPlayer(String file)
file - The file to be played, using internal path representationpublic void setVolume(float v)
v - Should be between 0 and 1public void play()
public void stop()
public boolean isPlaying()
public boolean isLooping()
public void loop()
public void dispose()
dispose in interface DisposableCopyright © 2014-2016 gdx2d - https://github.com/hevs-isi/gdx2d