ISA - 标题分割选项 - Division Title Options
在使用前请先使用:http://rpg.blue/thread-169595-1-1.html
#______________________________________________________________________________# * 此脚本归66RPG - Idint Script Association(ISA)所有,谢绝任何形式转载。#______________________________________________________________________________#==============================================================================# ■ 标题分割选项 - Division Title Options#------------------------------------------------------------------------------# 遵守协议:66RPG - Idint Script Association(ISA)# 初始脚本:忧雪の伤# 更新优化:无# 当前版本:1.0.0.1#------------------------------------------------------------------------------# 更新日记:忧雪の伤(2011.3.12)# - 初始化对象# 忧雪の伤(2011.3.13)# - 修复致命问题#------------------------------------------------------------------------------# 功能介绍:把标题选项分割成三个独立的窗口。# 使用方法:插入接入包的下端处。# 存在问题:无#==============================================================================#--------------------------------------------------------------------------# ● 资料记录#--------------------------------------------------------------------------module ISA Use["标题分割选项"] = System["标题分割选项"] = {}end#--------------------------------------------------------------------------# ● 设定部分#--------------------------------------------------------------------------module ISASystem["标题分割选项"]["高度间隔"] = 70System["标题分割选项"]["新游戏"] = "新游戏"System["标题分割选项"]["继续"] = "继续"System["标题分割选项"]["退出"] = "退出"System["标题分割选项"]["字体大小"] = 20end#==============================================================================# ■ Window_Title_command#------------------------------------------------------------------------------# 显示标题选项的窗口。#==============================================================================class Window_Title_command < Window_Baseinclude ISA#--------------------------------------------------------------------------# ● 初始化窗口#--------------------------------------------------------------------------def initialize(name) super(0, 0, 152, 64) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 160 @name = name refreshend#--------------------------------------------------------------------------# ● 刷新#--------------------------------------------------------------------------def refresh self.contents.clear self.contents.font.size = System["标题分割选项"]["字体大小"] self.contents.draw_text(0, 0, 120, 32, @name, 1)endend#==============================================================================# ■ Window_Command#------------------------------------------------------------------------------# 一般的命令选择行窗口。#==============================================================================class Window_Command < Window_Selectable#--------------------------------------------------------------------------# ● 初始化对像# width : 窗口的宽# commands : 命令字符串序列#--------------------------------------------------------------------------alias :division_title_options_initialize :initialize unless method_defined? :division_title_options_initializedef initialize(width, commands) division_title_options_initialize(width, commands) if $scene.is_a?(Scene_Title) self.visible = false self.active = false self.index = -1 endendend#==============================================================================# ■ Scene_Title#------------------------------------------------------------------------------# 处理标题画面的类。#==============================================================================class Scene_Title include ISA#--------------------------------------------------------------------------# ● 主处理#--------------------------------------------------------------------------alias :division_title_options_main :main unless method_defined? :division_title_options_maindef main $data_system = load_data("Data/System.rxdata") $game_system = Game_System.new name = [] name = System["标题分割选项"]["新游戏"] name = System["标题分割选项"]["继续"] name = System["标题分割选项"]["退出"] @title_command = [] @title_command = Window_Title_command.new(name) @title_command = Window_Title_command.new(name) @title_command = Window_Title_command.new(name) for i in 0..2 @title_command.x = 320 - @title_command.width / 2 @title_command.y = 288 - System["标题分割选项"]["高度间隔"] end @title_command.y += System["标题分割选项"]["高度间隔"] @title_command.y += System["标题分割选项"]["高度间隔"] * 2 @title_command_index = 0 @continue_enabled = false for i in 0..3 if FileTest.exist?("Save#{i+1}.rxdata") @continue_enabled = true end end if @continue_enabled @title_command_index = 1 else @title_command.contents_opacity = 160 end division_title_options_main for i in 0..2 @title_command.dispose endend#--------------------------------------------------------------------------# ● 刷新画面#--------------------------------------------------------------------------alias :division_title_options_update :update unless method_defined? :division_title_options_updatedef update division_title_options_update if Input.trigger?(Input::DOWN) $game_system.se_play($data_system.cursor_se) if @title_command_index > 1 @title_command_index = 0 else @title_command_index += 1 end end if Input.trigger?(Input::UP) $game_system.se_play($data_system.cursor_se) if @title_command_index < 1 @title_command_index = 2 else @title_command_index -= 1 end end if Input.trigger?(Input::C) case @title_command_index when 0 command_new_game when 1 command_continue when 2 command_shutdown end end case @title_command_index when 0 @title_command.opacity = 255 @title_command.opacity = 160 @title_command.opacity = 160 when 1 @title_command.opacity = 160 @title_command.opacity = 255 @title_command.opacity = 160 when 2 @title_command.opacity = 160 @title_command.opacity = 160 @title_command.opacity = 255 endendend复制代码
使用方法脚本内……截图下面
本帖来自P1论坛作者忧雪の伤,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=169695若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
页:
[1]