| 
 
| 赞 | 0 |  
| VIP | 0 |  
| 好人卡 | 1 |  
| 积分 | 1 |  
| 经验 | 2279 |  
| 最后登录 | 2013-7-31 |  
| 在线时间 | 87 小时 |  
 Lv1.梦旅人 
	梦石0 星屑50 在线时间87 小时注册时间2011-7-27帖子34 | 
| #------------------------------------------------------------------------------- # ·音乐选择播放器  By 退屈£无聊
 #-------------------------------------------------------------------------------
 # 呃。无聊写个东西玩先。 Update V1.02
 # 介绍说明。音乐的设置格式 @music* = [名称,文件名, 简介],注意文字要加引号!
 # 加了歌的话,在调用choose_music也要注意了。
 # 相信也应该制作完成了吧。没有BUG了吧-0-。
 $是否退出关闭音乐 = true
 #-------------------------------------------------------------------------------
 class Scene_Music
 #===================================================
 # ·主过程
 #===================================================
 def main
 @music1 = [名称,文件名, 简介]
 @music2 = [名称,文件名, 简介]
 @music3 = [名称,文件名, 简介]
 @music_command = Window_Command.new(200, [@music1[0], @music2[0], @music3[0]])
 @music_command.x = 0
 @music_command.y = 0
 @music_command.opacity = 150
 @music_command.z = 9999
 @help_window = Window_MusicHelp.new
 @help_window.x = 200
 @help_window.y = 0
 @help_window.width = 440
 @help_window.height = 480
 @help_window.opacity = 150
 @help_window.z = 9999
 # 执行过渡
 Graphics.transition
 # 主循环
 loop do
 # 刷新游戏画面
 Graphics.update
 # 刷新输入信息
 Input.update
 # 刷新画面
 choose_music([@music1, @music2, @music3]) # 音乐如果有填加,不要忘了在这里填加!
 # 如果画面被切换的话就中断循环
 if $scene != self
 break
 end
 end
 # 准备过渡
 Graphics.freeze
 # 释放窗口
 @music_command.dispose
 @help_window.dispose
 end
 #==========================================================================
 # ·选歌过程
 #==========================================================================
 def choose_music(music)
 @music_command.update
 @help_window.update
 @musicfile = music
 if Input.trigger?(Input::B)
 $scene = Scene_Map.new
 if $是否退出关闭音乐
 $game_map.autoplay
 end
 end
 if Input.trigger?(Input::C)
 @music_name = "#{@musicfile[@music_command.index][1]}"
 Audio.bgm_play("Audio/BGM/" + @music_name , 84, 0)
 end
 @help_window.draw_music("#{@musicfile[@music_command.index][2]}")
 end
 #===========================透明部分==================================
 module XRXS_MP7_Module
 def create_spriteset
 @spriteset = Spriteset_Map.new
 end
 def dispose_spriteset
 @spriteset.dispose
 end
 end
 include XRXS_MP7_Module
 alias xrxs_mp7_main main
 def main
 create_spriteset
 xrxs_mp7_main
 dispose_spriteset
 end
 #=========不需要的删到这里为止======================
 end
 #==============================================================================
 # ■ Window_Music
 #------------------------------------------------------------------------------
 #  音乐简介显示窗口。
 #==============================================================================
 
 class Window_MusicHelp < Window_Base
 #--------------------------------------------------------------------------
 # ● 初始化对像
 #--------------------------------------------------------------------------
 def initialize
 super(240, 0, 400, 480)
 self.contents = Bitmap.new(self.width - 32, self.height - 32)
 end
 #--------------------------------------------------------------------------
 # ● 描绘音乐
 #--------------------------------------------------------------------------
 def draw_music(music)
 self.contents.clear
 # 记录文字x坐标
 x = 0
 # 记录文字y坐标
 y = 0
 # 记录换行时y坐标最小加值
 min_y = 0
 self.contents.font.color = normal_color
 # 描绘音乐简介
 text = music
 # 限制文字处理
 begin
 last_text = text.clone
 text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
 end until text == last_text
 text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
 $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
 end
 # c 获取 1 个字 (如果不能取得文字就循环)
 while ((c = text.slice!(/./m)) != nil)
 # 另起一行文字的情况下
 if c == "\n"
 y += [32, min_y].max
 min_y = 0
 x = 0
 # 下面的文字
 next
 end
 # 自动换行处理
 if x + self.contents.text_size(c).width > self.contents.width
 y += [32, min_y].max
 min_y = 0
 x = 0
 end
 # 描绘文字
 self.contents.draw_text(4 + x, y, 40, 32, c)
 # x 为要描绘文字的加法运算
 x += self.contents.text_size(c).width
 end
 end
 end
 
 这一部分
 @music1 = [名称,文件名, 简介]
 @music2 = [名称,文件名, 简介]
 @music3 = [名称,文件名, 简介]
 要怎么填啊,我填完之后会提示错误...不知道为什么,希望能帮忙解决一下,谢谢
 | 
 |