The data class for BGS. This class has functionality for playing itself using an Audio module.
Gets the BGS (RPG::BGS) that is currently playing.
Also saves the current playback position in the obtained object. (RGSS3)
Returns an empty object if no BGS is playing.
Stops BGS playback.
Starts BGS fadeout. time is the length of the fadeout in milliseconds.
Starts the BGS playback.
The starting position can be specified by pos for ogg or wav files. (RGSS3)
Replays BGS obtained by RPG::BGS.last.
class RPG::BGS < RPG::AudioFile
@@last = RPG::BGS.new
def play(pos = 0)
if @name.empty?
Audio.bgs_stop
@@last = RPG::BGS.new
else
Audio.bgs_play('Audio/BGS/' + @name, @volume, @pitch, pos)
@@last = self.clone
end
end
def replay
play(@pos)
end
def self.stop
Audio.bgs_stop
@@last = RPG::BGS.new
end
def self.fade(time)
Audio.bgs_fade(time)
@@last = RPG::BGS.new
end
def self.last
@@last.pos = Audio.bgs_pos
@@last
end
attr_accessor :pos
end