Class: Gosu::SampleInstance

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

Overview

An instance of a Sample playing. Can be used to stop sounds dynamically, or to check if they are finished. It is recommended that you throw away sample instances if possible, as they could accidentally refer to other sounds being played after a very long time has passed.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) pan=(value) (writeonly)

Sets the attribute pan

Parameters:

  • value

    the value to set the attribute pan to.



435
436
437
# File 'reference/gosu.rb', line 435

def pan=(value)
  @pan = value
end

- (Object) speed=(value) (writeonly)

Sets the attribute speed

Parameters:

  • value

    the value to set the attribute speed to.



434
435
436
# File 'reference/gosu.rb', line 434

def speed=(value)
  @speed = value
end

- (Object) volume=(value) (writeonly)

Sets the attribute volume

Parameters:

  • value

    the value to set the attribute volume to.



433
434
435
# File 'reference/gosu.rb', line 433

def volume=(value)
  @volume = value
end

Instance Method Details

- (Object) pause

Pauses this instance to be resumed afterwards. It will still keep a channel filled while paused.



440
# File 'reference/gosu.rb', line 440

def pause; end

- (Boolean) paused?

Returns:

  • (Boolean)


441
# File 'reference/gosu.rb', line 441

def paused?; end

- (Boolean) playing?

Returns:

  • (Boolean)


443
# File 'reference/gosu.rb', line 443

def playing?; end

- (Object) resume



442
# File 'reference/gosu.rb', line 442

def resume; end

- (Object) stop

Stops this instance of a sound being played. Calling this twice, or too late, does not do any harm. You can nil out the reference to the instance afterwards as it will be useless.



438
# File 'reference/gosu.rb', line 438

def stop; end