RPG::BGS

The data class for BGS. This class has functionality for playing itself using an Audio module.

Superclass

Referrers

Class Methods

RPG::BGS.last

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.

RPG::BGS.stop

Stops BGS playback.

RPG::BGS.fade(time)

Starts BGS fadeout. time is the length of the fadeout in milliseconds.

Methods

play([pos]) (RGSS3)

Starts the BGS playback.

The starting position can be specified by pos for ogg or wav files. (RGSS3)

replay (RGSS3)

Replays BGS obtained by RPG::BGS.last.

Definition

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