Class: Gosu::Song
- Inherits:
-
Object
- Object
- Gosu::Song
- Defined in:
- reference/gosu.rb
Overview
Songs are less flexible than samples in that they can only be played one at a time and without panning or speed parameters.
Instance Attribute Summary (collapse)
-
- (Object) volume
Returns the value of attribute volume.
Class Method Summary (collapse)
-
+ (Object) current_song
Returns the song currently being played or paused, or nil if no song has been played yet or the last song has finished playing.
Instance Method Summary (collapse)
-
- (Song) initialize(window, filename)
constructor
A new instance of Song.
-
- (Object) pause
Pauses playback of the song.
-
- (Boolean) paused?
Returns true if the song is the current song, but in paused mode.
-
- (Object) play(looping = false)
Starts or resumes playback of the song.
-
- (Boolean) playing?
Returns true if the song is currently playing.
-
- (Object) stop
Stops playback of this song if it is currently played or paused.
Constructor Details
- (Song) initialize(window, filename)
A new instance of Song
456 |
# File 'reference/gosu.rb', line 456 def initialize(window, filename) end |
Instance Attribute Details
- (Object) volume
Returns the value of attribute volume
454 455 456 |
# File 'reference/gosu.rb', line 454 def volume @volume end |
Class Method Details
+ (Object) current_song
Returns the song currently being played or paused, or nil if no song has been played yet or the last song has finished playing.
452 |
# File 'reference/gosu.rb', line 452 def self.current_song; end |
Instance Method Details
- (Object) pause
Pauses playback of the song. It is not considered being played. current_song will stay the same.
464 |
# File 'reference/gosu.rb', line 464 def pause; end |
- (Boolean) paused?
Returns true if the song is the current song, but in paused mode.
468 |
# File 'reference/gosu.rb', line 468 def paused?; end |
- (Object) play(looping = false)
Starts or resumes playback of the song. This will stop all other songs and set the current song to this object.
460 |
# File 'reference/gosu.rb', line 460 def play(looping=false) end |
- (Boolean) playing?
Returns true if the song is currently playing.
475 |
# File 'reference/gosu.rb', line 475 def ; end |
- (Object) stop
Stops playback of this song if it is currently played or paused. Afterwards, current_song will return 0.
472 |
# File 'reference/gosu.rb', line 472 def stop; end |