Project1
标题:
请问如何在菜单画面实现CD的转动(音乐鉴赏相关)
[打印本页]
作者:
闪电
时间:
2008-9-16 05:39
标题:
请问如何在菜单画面实现CD的转动(音乐鉴赏相关)
顺便感谢下IamI朋友上次的帮忙
class Window_Enjoy < Window_Base
def initialize
super(640 - 224,480 - 152,224,152)
self.contents = Bitmap.new(width - 32,height - 32)
end
def update(ar)
refresh(ar)
end
def refresh(ar)
self.contents.clear
self.contents.draw_text(0,32*0,192,32,ar[0])
self.contents.draw_text(0,32*1,192,32,"出处: " + ar[1])
self.contents.draw_text(0,32*2,192,32,"制作人:" + ar[2])
self.contents.draw_text(0,32*3,192,32,"词作者:" + ar[3])
end
end
class Scene_Music
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
# 生成命令窗口
s1 = "music1"
s2 = "music2"
s3 = "music3"
s4 = "music4"
@command_window = Window_Command.new(192, [s1, s2, s3,s4])
@command_window.x = 0
@command_window.y = 0
@musicname = ["001-Battle01","002-Battle02","003-Battle03","004-Battle04"]
@enjoys = [["music1","From","Maker","Words Maker"],
["music2","From","Maker","Words Maker"],
["music3","From","Maker","Words Maker"],
["music4","From","Maker","Words Maker"]]
@enjoy_window = Window_Enjoy.new
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
if $scene.is_a?(Scene_Title)
Graphics.transition
Graphics.freeze
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
@enjoy_window.update(@enjoys[@command_window.index])
@command_window.update
# 按下 B 键的情况下
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Title.new
return
end
# 按下 C 键的场合下
if Input.trigger?(Input::C)
# 命令窗口光标位置分支
name = "Audio/BGM/" + @musicname[@command_window.index]
Audio.bgm_play(name)
return
end
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1