Class: SlideField::ObjectManager::Song

Inherits:
Base
  • Object
show all
Defined in:
lib/slidefield/objects/song.rb

Instance Method Summary collapse

Methods inherited from Base

#draw, #execute, #initialize, #unload

Constructor Details

This class inherits a constructor from SlideField::ObjectManager::Base

Instance Method Details

#activateObject



23
24
25
# File 'lib/slidefield/objects/song.rb', line 23

def activate
  @instance = @song.play @volume, 1, @loop
end

#deactivateObject



27
28
29
# File 'lib/slidefield/objects/song.rb', line 27

def deactivate
  @instance.stop
end

#loadObject



15
16
17
18
19
20
21
# File 'lib/slidefield/objects/song.rb', line 15

def load
  source = File.expand_path @obj.get(:source), @obj.include_path
  @loop = @obj.get(:loop)
  @volume = @obj.get(:volume) / 100.0

  @song = Gosu::Sample.new @window, source
end