Class: Gosu::Sample

Inherits:
Object
  • Object
show all
Defined in:
rdoc/gosu.rb

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 Also:

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ Sample #initialize(window, filename) ⇒ Sample

Loads a sample from a file.

(Passing a Window reference is not necessary anymore, please use the first overload from now on.)



569
# File 'rdoc/gosu.rb', line 569

def initialize(filename); end

Instance Method Details

#play(volume = 1, speed = 1, looping = false) ⇒ Channel

Plays the sample without panning.

See Also:



580
# File 'rdoc/gosu.rb', line 580

def play(volume=1, speed=1, looping=false); end

#play_pan(pan = 0, volume = 1, speed = 1, looping = false) ⇒ Channel

Plays the sample with panning.

See Also:



592
# File 'rdoc/gosu.rb', line 592

def play_pan(pan=0, volume=1, speed=1, looping=false); end