class Gosu::Song
- Gosu::Song
- Reference
- Object
Overview
Songs are less flexible than samples in that only one can be played at a time, with no panning or speed control.
See Gosu::Sample
Defined in:
gosu/song.crConstructors
-
.new(filename : String)
Loads a song from a file.
Class Method Summary
-
.current_song : Gosu::Song | Nil
Returns the song currently being played (even if it's paused), or nil if no song is playing.
Instance Method Summary
-
#pause
Pauses playback of the song.
-
#paused? : Bool
Returns true if this song is the current song and playback is paused.
-
#play(looping : Bool = false)
Starts or resumes playback of the song.
-
#playing? : Bool
Returns whether the song is playing.
-
#stop
Stops playback if this song is the current song.
-
#volume : Float64
Returns the song's playback volume.
-
#volume=(double : Float64)
Sets the song's playback volume.
Constructor Detail
Class Method Detail
Returns the song currently being played (even if it's paused), or nil if no song is playing.
Instance Method Detail
Starts or resumes playback of the song.
If another song is currently playing, it will be stopped and this song will be set as the current song.
If looping
is false, the current song will be set to nil
when this song finishes.
looping
whether the song should play in a loop.