Class: RPG::BGS

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

Constant Summary collapse

@@last =
RPG::BGS.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.



72
73
74
# File 'lib/rgss3/rpg.rb', line 72

def pos
  @pos
end

Class Method Details

.fade(time) ⇒ Object



64
65
66
67
# File 'lib/rgss3/rpg.rb', line 64

def self.fade(time)
  Audio.bgs_fade(time)
  @@last = RPG::BGS.new
end

.lastObject



68
69
70
71
# File 'lib/rgss3/rpg.rb', line 68

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

.stopObject



60
61
62
63
# File 'lib/rgss3/rpg.rb', line 60

def self.stop
  Audio.bgs_stop
  @@last = RPG::BGS.new
end

Instance Method Details

#play(pos = 0) ⇒ Object



48
49
50
51
52
53
54
55
56
# File 'lib/rgss3/rpg.rb', line 48

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

#replayObject



57
58
59
# File 'lib/rgss3/rpg.rb', line 57

def replay
  play(@pos)
end