#==============================================================================
# ■Window_Music by nanikoyizi
#------------------------------------------------------------------------------
# 在地图上显示当前演奏的音乐的窗口脚本
# 这个是为了给注重音乐的游戏使用的(σ ̄▽ ̄)σ
#==============================================================================
class Window_Music < Window_Base
#--------------------------------------------------------------------------
# ●初始化
#--------------------------------------------------------------------------
def initialize
super(0,0,640,96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = 22 #这里可以调文字大小
@OP = 0
@OP2 = 0
@r = 100 #字幕持续时间
@Turn = false
$MusicName = "摘自网络"
$Artist = "无"
case $game_system.playing_bgm.name
when "山路"
$MusicName = "平均律第一册 BWV846前奏曲"
$Artist = "巴赫"
when "起始城教堂"
$MusicName = "BWV565 赋格"
$Artist = "巴赫"
end
self.opacity = 0
end
#--------------------------------------------------------------------------
# ●更新
#--------------------------------------------------------------------------
def update
if @OP > 0 or @Turn == false
self.contents.clear
if @Turn == false
@OP += 4 #字幕出现渐变速度
@OP2 += 160/51 #((4*200/5)/(255/5))
else
@OP -= 4 #字幕消失渐变速度
@OP2 -= 160/51 #((4*200/5)/(255/5))
end
self.contents.font.color = Color.new(0, 0, 0, @OP2)
self.contents.font.name = "Arial Black"
self.contents.draw_text(2, 2, 10, 32, "♪ ")
self.contents.font.name = "黑体"
self.contents.draw_text(12, 4, 640, 32, $MusicName)
self.contents.font.color = Color.new(255, 255, 255, @OP)
self.contents.font.name = "Arial Black"
self.contents.draw_text(0, 0, 10, 32, "♪ ")
self.contents.font.name = "黑体"
self.contents.draw_text(10, 2, 640, 32, $MusicName)
if $Artist != nil
self.contents.font.color = Color.new(0, 0, 0, @OP2)
self.contents.draw_text(2, 34, 640, 32, "作者:" + $Artist)
self.contents.font.color = Color.new(255, 255, 255, @OP)
self.contents.draw_text(0, 32, 640, 32, "作者:" + $Artist)
end
if @OP >= 255
@r -= 1
if @r == 0
@Turn = true
end
end
end
end
end