Class: RPG::BGM

Inherits:
AudioFile show all
Defined in:
lib/R3EXS/RGSS3.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.



1389
1390
1391
# File 'lib/R3EXS/RGSS3.rb', line 1389

def pos
  @pos
end

Class Method Details

.fade(time) ⇒ Object



1379
1380
1381
1382
# File 'lib/R3EXS/RGSS3.rb', line 1379

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

.lastObject



1384
1385
1386
1387
# File 'lib/R3EXS/RGSS3.rb', line 1384

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

.stopObject



1374
1375
1376
1377
# File 'lib/R3EXS/RGSS3.rb', line 1374

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

Instance Method Details

#play(pos = 0) ⇒ Object



1360
1361
1362
1363
1364
1365
1366
1367
1368
# File 'lib/R3EXS/RGSS3.rb', line 1360

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



1370
1371
1372
# File 'lib/R3EXS/RGSS3.rb', line 1370

def replay
    play(@pos)
end