class Gosu::Sample
- Gosu::Sample
- Reference
- Object
Overview
A sample is a short sound that is completely loaded in memory, can be played multiple times at once and offers very flexible playback parameters. Use samples for everything that's not music.
See Gosu::Song
Defined in:
gosu/sample.crConstructors
-
.new(filename : String)
Loads a sample from a file.
Instance Method Summary
-
#play(volume : Float64 = 1.0, speed : Float64 = 1.0, looping : Bool = false) : Gosu::Channel
Plays the sample without panning.
-
#play_pan(pan : Float64 = 0.0, volume : Float64 = 1.0, speed : Float64 = 1.0, looping : Bool = false) : Gosu::Channel
Plays the sample with panning.
Constructor Detail
Instance Method Detail
Plays the sample without panning.
volume
see Channel#volume=
speed
see Channel#speed=
looping
whether the sample should play in a loop. If you pass true, be sure
to store the return value of this method so that you can later stop the looping sound.
See #play_pan
Plays the sample with panning.
pan
see Channel#pan=
volume
see Channel#volume=
speed
see Channel#speed=
looping
whether the sample should play in a loop. If you pass true, be sure
to store the return value of this method so that you can later stop the looping sound.
See #play