Class: SlideField::ObjectManager::Song
- Inherits:
-
Base
- Object
- Base
- SlideField::ObjectManager::Song
show all
- Defined in:
- lib/slidefield/objects/song.rb
Instance Method Summary
collapse
Methods inherited from Base
#execute, #initialize, #method_missing, #on_draw
Instance Method Details
#on_activate ⇒ Object
23
24
25
|
# File 'lib/slidefield/objects/song.rb', line 23
def on_activate
@instance = @song.play @volume, 1, @loop
end
|
#on_deactivate ⇒ Object
27
28
29
30
|
# File 'lib/slidefield/objects/song.rb', line 27
def on_deactivate
@instance.stop
@instance = nil
end
|
#on_load ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/slidefield/objects/song.rb', line 15
def on_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
|
#on_unload ⇒ Object
32
33
34
|
# File 'lib/slidefield/objects/song.rb', line 32
def on_unload
@song = nil
end
|