Class: RPG::BGM

Inherits:
AudioFile show all
Defined in:
lib/rgss3/rpg.rb

Constant Summary collapse

@@last =
RPG::BGM.new

Instance Attribute Summary collapse

Attributes inherited from AudioFile

#name, #pitch, #volume

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AudioFile

#initialize

Constructor Details

This class inherits a constructor from RPG::AudioFile

Instance Attribute Details

#posObject

Returns the value of attribute pos.



42
43
44
# File 'lib/rgss3/rpg.rb', line 42

def pos
  @pos
end

Class Method Details

.fade(time) ⇒ Object



34
35
36
37
# File 'lib/rgss3/rpg.rb', line 34

def self.fade(time)
  Audio.bgm_fade(time)
  @@last = RPG::BGM.new
end

.lastObject



38
39
40
41
# File 'lib/rgss3/rpg.rb', line 38

def self.last
  @@last.pos = Audio.bgm_pos
  @@last
end

.stopObject



30
31
32
33
# File 'lib/rgss3/rpg.rb', line 30

def self.stop
  Audio.bgm_stop
  @@last = RPG::BGM.new
end

Instance Method Details

#play(pos = 0) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/rgss3/rpg.rb', line 18

def play(pos = 0)
  if @name.empty?
    Audio.bgm_stop
    @@last = RPG::BGM.new
  else
    Audio.bgm_play('Audio/BGM/' + @name, @volume, @pitch, pos)
    @@last = self.clone
  end
end

#replayObject



27
28
29
# File 'lib/rgss3/rpg.rb', line 27

def replay
  play(@pos)
end