赞 | 4 |
VIP | 8 |
好人卡 | 2 |
积分 | 1 |
经验 | 14991 |
最后登录 | 2019-7-31 |
在线时间 | 602 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 78
- 在线时间
- 602 小时
- 注册时间
- 2012-4-20
- 帖子
- 608
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 星月铃音 于 2014-7-30 20:32 编辑
先贴一个完成效果,依旧是短九的作品。
那么,做成这样子的菜单要怎么进行呢?下面就是教程~
首先,我们要在脚本列表的最开头添加以下的脚本
Graphics.resize_screen(800,480)
Graphics.resize_screen(800,480)
下一步。我们打开vocab,添加
# 自定画面 Map = "所在地" Ssave = " 存储进度"
# 自定画面
Map = "所在地"
Ssave = " 存储进度"
下一步,打开Cache,作如下修改。
46行end后加入
#-------------------------------------------------------------------------- # ● 获取角色半身肖像图 #-------------------------------------------------------------------------- def self.HalfBody(filename) load_bitmap("Graphics/HalfBody/", filename) end
#--------------------------------------------------------------------------
# ● 获取角色半身肖像图
#--------------------------------------------------------------------------
def self.HalfBody(filename)
load_bitmap("Graphics/HalfBody/", filename)
end
下一步,打开Window_Base,作如下修改
1,395行后面添加---这里错了,应该是414
#-------------------------------------------------------------------------- # ● 绘制角色半身肖像图 # enabled : 有效的标志。false 的时候使用半透明效果绘制 #-------------------------------------------------------------------------- def draw_HalfBody(face_name, face_index, x, y, enabled = true) bitmap = Cache.HalfBody(face_name) rect = Rect.new(face_index % 1 * 96, face_index / 1 * 194, 134, 280) contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha) bitmap.dispose end
#--------------------------------------------------------------------------
# ● 绘制角色半身肖像图
# enabled : 有效的标志。false 的时候使用半透明效果绘制
#--------------------------------------------------------------------------
def draw_HalfBody(face_name, face_index, x, y, enabled = true)
bitmap = Cache.HalfBody(face_name)
rect = Rect.new(face_index % 1 * 96, face_index / 1 * 194, 134, 280)
contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
bitmap.dispose
end
2,456行后面添加
#-------------------------------------------------------------------------- # ● 绘制角色半肖像图 #-------------------------------------------------------------------------- def draw_actor_HalfBody(actor, x, y, enabled = true) draw_HalfBody(actor.face_name, actor.face_index, x, y, enabled) end
#--------------------------------------------------------------------------
# ● 绘制角色半肖像图
#--------------------------------------------------------------------------
def draw_actor_HalfBody(actor, x, y, enabled = true)
draw_HalfBody(actor.face_name, actor.face_index, x, y, enabled)
end
3,470添加- #--------------------------------------------------------------------------
- # ● 绘制菜单名字
- #--------------------------------------------------------------------------
- def draw_actor_mname(actor, x, y, width = 200)
- contents.font.size += 7
- contents.font.name = ["华康雅宋体W9(P)", "黑体"]
- change_color(hp_color(actor))
- draw_text(x, y, width, line_height, actor.name)
- contents.font.size -= 7
- contents.font.name = "黑体"
- End
复制代码 4,494添加
#-------------------------------------------------------------------------- # ● 绘制等级 菜单 #-------------------------------------------------------------------------- def draw_actor_mlevel(actor, x, y) change_color(normal_color) contents.font.size += 10 contents.font.name = ["Old English Text MT", "黑体"] contents.font.shadow = true draw_text(x + 55, y, 100, line_height, Vocab::level_a) contents.font.size -= 10 change_color(normal_color) contents.font.size += 30 draw_text(x + 32, y-15, 100, line_height*2, actor.level, 2) contents.font.size -= 30 contents.font.name = "黑体" contents.font.shadow = false End
#--------------------------------------------------------------------------
# ● 绘制等级 菜单
#--------------------------------------------------------------------------
def draw_actor_mlevel(actor, x, y)
change_color(normal_color)
contents.font.size += 10
contents.font.name = ["Old English Text MT", "黑体"]
contents.font.shadow = true
draw_text(x + 55, y, 100, line_height, Vocab::level_a)
contents.font.size -= 10
change_color(normal_color)
contents.font.size += 30
draw_text(x + 32, y-15, 100, line_height*2, actor.level, 2)
contents.font.size -= 30
contents.font.name = "黑体"
contents.font.shadow = false
End
替换Window_MenuStatus
#encoding:utf-8 #============================================================================== # ■ Window_MenuStatus #------------------------------------------------------------------------------ # 菜单画面中,显示队伍成员状态的窗口 #============================================================================== class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # ● 获取首列位置 #-------------------------------------------------------------------------- def top_col ox / (item_width + spacing) end #-------------------------------------------------------------------------- # ● 设置首列位置 #-------------------------------------------------------------------------- def top_col=(col) col = 0 if col < 0 #col = col_max - 1 if col > col_max self.ox = col * (item_width + spacing) end #-------------------------------------------------------------------------- # ● 获取尾列位置 #-------------------------------------------------------------------------- def bottom_col top_col + col_max - 1 end #-------------------------------------------------------------------------- # ● 设置尾列位置 #-------------------------------------------------------------------------- def bottom_col=(col) self.top_col = col - (col_max - 1) end #-------------------------------------------------------------------------- # ● 确保光标在画面范围内滚动 #-------------------------------------------------------------------------- def ensure_cursor_visible self.top_col = index if index < top_col self.bottom_col = index if index > bottom_col end #-------------------------------------------------------------------------- # ● 获取项目的绘制矩形 #-------------------------------------------------------------------------- def item_rect(index) rect = super rect.x = index * (item_width + spacing) rect.y = 0 rect end #-------------------------------------------------------------------------- # ● 获取对齐方向 #-------------------------------------------------------------------------- def alignment return 1 end #-------------------------------------------------------------------------- # ● 光标向下移动 #-------------------------------------------------------------------------- def cursor_down(wrap = false) end #-------------------------------------------------------------------------- # ● 光标向上移动 #-------------------------------------------------------------------------- def cursor_up(wrap = false) end #-------------------------------------------------------------------------- # ● 光标移至下一页 #-------------------------------------------------------------------------- def cursor_pagedown end #-------------------------------------------------------------------------- # ● 光标移至上一页 #-------------------------------------------------------------------------- def cursor_pageup end #-------------------------------------------------------------------------- # ● 定义实例变量 #-------------------------------------------------------------------------- attr_reader :pending_index # 保留位置(整队用) #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize(x, y) super(110, 50, 580, 380) @pending_index = -1 refresh end #-------------------------------------------------------------------------- # ● 获取窗口的宽度 #-------------------------------------------------------------------------- def window_width 580 end #-------------------------------------------------------------------------- # ● 获取列数 #-------------------------------------------------------------------------- def col_max return 4 #跟据分辨率的不同可以改 end #-------------------------------------------------------------------------- # ● 获取窗口的高度 #-------------------------------------------------------------------------- def window_height Graphics.height end #-------------------------------------------------------------------------- # ● 获取项目数 #-------------------------------------------------------------------------- def item_max $game_party.members.size end #-------------------------------------------------------------------------- # ● 获取项目的高度 #-------------------------------------------------------------------------- def item_height height - standard_padding * 2 end #-------------------------------------------------------------------------- # ● 获取项目的宽度 #-------------------------------------------------------------------------- def item_width (width - standard_padding * 2 + spacing) /col_max - spacing end #-------------------------------------------------------------------------- # ● 获取行间距的宽度 #-------------------------------------------------------------------------- def spacing return 0 end #-------------------------------------------------------------------------- # ● 计算窗口内容的宽度 #-------------------------------------------------------------------------- def contents_width (item_width + spacing) * item_max - spacing end #-------------------------------------------------------------------------- # ● 计算窗口内容的宽度 #-------------------------------------------------------------------------- def contents_height item_height end #-------------------------------------------------------------------------- # ● 绘制项目 #-------------------------------------------------------------------------- def draw_item(index) actor = $game_party.members[index] enabled = $game_party.battle_members.include?(actor) rect = item_rect(index) draw_item_background(index) draw_actor_HalfBody(actor, rect.x+1.5, rect.y, enabled) draw_actor_mname(actor,rect.x, rect.y+5) draw_actor_class(actor,rect.x, rect.y+5+line_height*1) draw_actor_icons(actor,rect.x,rect.y+205+line_height*1) draw_actor_mlevel(actor,rect.x, rect.y+205+line_height*2) draw_actor_hp(actor,rect.x+7.5,rect.y+205+line_height*3) draw_actor_mp(actor,rect.x+7.5,rect.y+205+line_height*4) draw_actor_tp(actor,rect.x+7.5,rect.y+205+line_height*5) end #-------------------------------------------------------------------------- # ● 绘制项目的背景 #-------------------------------------------------------------------------- def draw_item_background(index) if index == @pending_index contents.fill_rect(item_rect(index), pending_color) end end #-------------------------------------------------------------------------- # ● 按下确定键时的处理 #-------------------------------------------------------------------------- def process_ok super $game_party.menu_actor = $game_party.members[index] end #-------------------------------------------------------------------------- # ● 返回上一个选择的位置 #-------------------------------------------------------------------------- def select_last select($game_party.menu_actor.index || 0) end #-------------------------------------------------------------------------- # ● 设置保留位置(整队用) #-------------------------------------------------------------------------- def pending_index=(index) last_pending_index = @pending_index @pending_index = index redraw_item(@pending_index) redraw_item(last_pending_index) end end
#encoding:utf-8
#==============================================================================
# ■ Window_MenuStatus
#------------------------------------------------------------------------------
# 菜单画面中,显示队伍成员状态的窗口
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# ● 获取首列位置
#--------------------------------------------------------------------------
def top_col
ox / (item_width + spacing)
end
#--------------------------------------------------------------------------
# ● 设置首列位置
#--------------------------------------------------------------------------
def top_col=(col)
col = 0 if col < 0
#col = col_max - 1 if col > col_max
self.ox = col * (item_width + spacing)
end
#--------------------------------------------------------------------------
# ● 获取尾列位置
#--------------------------------------------------------------------------
def bottom_col
top_col + col_max - 1
end
#--------------------------------------------------------------------------
# ● 设置尾列位置
#--------------------------------------------------------------------------
def bottom_col=(col)
self.top_col = col - (col_max - 1)
end
#--------------------------------------------------------------------------
# ● 确保光标在画面范围内滚动
#--------------------------------------------------------------------------
def ensure_cursor_visible
self.top_col = index if index < top_col
self.bottom_col = index if index > bottom_col
end
#--------------------------------------------------------------------------
# ● 获取项目的绘制矩形
#--------------------------------------------------------------------------
def item_rect(index)
rect = super
rect.x = index * (item_width + spacing)
rect.y = 0
rect
end
#--------------------------------------------------------------------------
# ● 获取对齐方向
#--------------------------------------------------------------------------
def alignment
return 1
end
#--------------------------------------------------------------------------
# ● 光标向下移动
#--------------------------------------------------------------------------
def cursor_down(wrap = false)
end
#--------------------------------------------------------------------------
# ● 光标向上移动
#--------------------------------------------------------------------------
def cursor_up(wrap = false)
end
#--------------------------------------------------------------------------
# ● 光标移至下一页
#--------------------------------------------------------------------------
def cursor_pagedown
end
#--------------------------------------------------------------------------
# ● 光标移至上一页
#--------------------------------------------------------------------------
def cursor_pageup
end
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_reader :pending_index # 保留位置(整队用)
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize(x, y)
super(110, 50, 580, 380)
@pending_index = -1
refresh
end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
580
end
#--------------------------------------------------------------------------
# ● 获取列数
#--------------------------------------------------------------------------
def col_max
return 4 #跟据分辨率的不同可以改
end
#--------------------------------------------------------------------------
# ● 获取窗口的高度
#--------------------------------------------------------------------------
def window_height
Graphics.height
end
#--------------------------------------------------------------------------
# ● 获取项目数
#--------------------------------------------------------------------------
def item_max
$game_party.members.size
end
#--------------------------------------------------------------------------
# ● 获取项目的高度
#--------------------------------------------------------------------------
def item_height
height - standard_padding * 2
end
#--------------------------------------------------------------------------
# ● 获取项目的宽度
#--------------------------------------------------------------------------
def item_width
(width - standard_padding * 2 + spacing) /col_max - spacing
end
#--------------------------------------------------------------------------
# ● 获取行间距的宽度
#--------------------------------------------------------------------------
def spacing
return 0
end
#--------------------------------------------------------------------------
# ● 计算窗口内容的宽度
#--------------------------------------------------------------------------
def contents_width
(item_width + spacing) * item_max - spacing
end
#--------------------------------------------------------------------------
# ● 计算窗口内容的宽度
#--------------------------------------------------------------------------
def contents_height
item_height
end
#--------------------------------------------------------------------------
# ● 绘制项目
#--------------------------------------------------------------------------
def draw_item(index)
actor = $game_party.members[index]
enabled = $game_party.battle_members.include?(actor)
rect = item_rect(index)
draw_item_background(index)
draw_actor_HalfBody(actor, rect.x+1.5, rect.y, enabled)
draw_actor_mname(actor,rect.x, rect.y+5)
draw_actor_class(actor,rect.x, rect.y+5+line_height*1)
draw_actor_icons(actor,rect.x,rect.y+205+line_height*1)
draw_actor_mlevel(actor,rect.x, rect.y+205+line_height*2)
draw_actor_hp(actor,rect.x+7.5,rect.y+205+line_height*3)
draw_actor_mp(actor,rect.x+7.5,rect.y+205+line_height*4)
draw_actor_tp(actor,rect.x+7.5,rect.y+205+line_height*5)
end
#--------------------------------------------------------------------------
# ● 绘制项目的背景
#--------------------------------------------------------------------------
def draw_item_background(index)
if index == @pending_index
contents.fill_rect(item_rect(index), pending_color)
end
end
#--------------------------------------------------------------------------
# ● 按下确定键时的处理
#--------------------------------------------------------------------------
def process_ok
super
$game_party.menu_actor = $game_party.members[index]
end
#--------------------------------------------------------------------------
# ● 返回上一个选择的位置
#--------------------------------------------------------------------------
def select_last
select($game_party.menu_actor.index || 0)
end
#--------------------------------------------------------------------------
# ● 设置保留位置(整队用)
#--------------------------------------------------------------------------
def pending_index=(index)
last_pending_index = @pending_index
@pending_index = index
redraw_item(@pending_index)
redraw_item(last_pending_index)
end
end
然后在 Window_MenuStatus上面添加两个脚本
#encoding:utf-8 #============================================================================== # ■ Window_ver #------------------------------------------------------------------------------ # 显示版本的窗口 #============================================================================== class Window_ver < Window_Base #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize super(0, 0, window_width, fitting_height(1)) refresh end #-------------------------------------------------------------------------- # ● 获取窗口的宽度 #-------------------------------------------------------------------------- def window_width return 250 end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh contents.clear draw_currency_value(value, currency_unit, 0, 0, contents.width - 8) end #-------------------------------------------------------------------------- # ● 获取持有金钱 #-------------------------------------------------------------------------- def value "版本号 1.0.0" end #-------------------------------------------------------------------------- # ● 获取货币单位 #-------------------------------------------------------------------------- def currency_unit end #-------------------------------------------------------------------------- # ● 打开窗口 #-------------------------------------------------------------------------- def open refresh super end end
#encoding:utf-8
#==============================================================================
# ■ Window_ver
#------------------------------------------------------------------------------
# 显示版本的窗口
#==============================================================================
class Window_ver < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize
super(0, 0, window_width, fitting_height(1))
refresh
end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
return 250
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_currency_value(value, currency_unit, 0, 0, contents.width - 8)
end
#--------------------------------------------------------------------------
# ● 获取持有金钱
#--------------------------------------------------------------------------
def value
"版本号 1.0.0"
end
#--------------------------------------------------------------------------
# ● 获取货币单位
#--------------------------------------------------------------------------
def currency_unit
end
#--------------------------------------------------------------------------
# ● 打开窗口
#--------------------------------------------------------------------------
def open
refresh
super
end
end
#encoding:utf-8 #============================================================================== # ■ Window_Map #------------------------------------------------------------------------------ # 显示地图的窗口 #============================================================================== class Window_Map < Window_Base #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize super(0, 0, window_width, fitting_height(1)) refresh end #-------------------------------------------------------------------------- # ● 获取窗口的宽度 #-------------------------------------------------------------------------- def window_width return 300 end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh contents.clear draw_currency_value(value, currency_unit, 0, 0, contents.width - 8) end #-------------------------------------------------------------------------- # ● 获取持有金钱 #-------------------------------------------------------------------------- def value Vocab::Map + " " + $game_map.display_name end #-------------------------------------------------------------------------- # ● 获取货币单位 #-------------------------------------------------------------------------- def currency_unit end #-------------------------------------------------------------------------- # ● 打开窗口 #-------------------------------------------------------------------------- def open refresh super end end
#encoding:utf-8
#==============================================================================
# ■ Window_Map
#------------------------------------------------------------------------------
# 显示地图的窗口
#==============================================================================
class Window_Map < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize
super(0, 0, window_width, fitting_height(1))
refresh
end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
return 300
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_currency_value(value, currency_unit, 0, 0, contents.width - 8)
end
#--------------------------------------------------------------------------
# ● 获取持有金钱
#--------------------------------------------------------------------------
def value
Vocab::Map + " " + $game_map.display_name
end
#--------------------------------------------------------------------------
# ● 获取货币单位
#--------------------------------------------------------------------------
def currency_unit
end
#--------------------------------------------------------------------------
# ● 打开窗口
#--------------------------------------------------------------------------
def open
refresh
super
end
end
#============================================================================== # ■ Window_Gold #------------------------------------------------------------------------------ # 显示持有金钱的窗口 #============================================================================== class Window_MGold < Window_Base #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize super(0, 0, window_width, fitting_height(1)) refresh end #-------------------------------------------------------------------------- # ● 获取窗口的宽度 #-------------------------------------------------------------------------- def window_width return 250 end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh contents.clear draw_currency_value(value, currency_unit, 4, 0, contents.width - 8) end #-------------------------------------------------------------------------- # ● 获取持有金钱 #-------------------------------------------------------------------------- def value $game_party.gold end #-------------------------------------------------------------------------- # ● 获取货币单位 #-------------------------------------------------------------------------- def currency_unit Vocab::currency_unit end #-------------------------------------------------------------------------- # ● 打开窗口 #-------------------------------------------------------------------------- def open refresh super end end
#==============================================================================
# ■ Window_Gold
#------------------------------------------------------------------------------
# 显示持有金钱的窗口
#==============================================================================
class Window_MGold < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize
super(0, 0, window_width, fitting_height(1))
refresh
end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
return 250
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_currency_value(value, currency_unit, 4, 0, contents.width - 8)
end
#--------------------------------------------------------------------------
# ● 获取持有金钱
#--------------------------------------------------------------------------
def value
$game_party.gold
end
#--------------------------------------------------------------------------
# ● 获取货币单位
#--------------------------------------------------------------------------
def currency_unit
Vocab::currency_unit
end
#--------------------------------------------------------------------------
# ● 打开窗口
#--------------------------------------------------------------------------
def open
refresh
super
end
end
这个是楼主自己改的,凑活用吧~
然后修改Window_MenuCommand,直接替换
#encoding:utf-8 #============================================================================== # ■ Window_MenuCommand #------------------------------------------------------------------------------ # 菜单画面中显示指令的窗口 #============================================================================== class Window_MenuCommand < Window_HorzCommand #-------------------------------------------------------------------------- # ● 初始化指令选择位置(类方法) #-------------------------------------------------------------------------- def self.init_command_position @@last_command_symbol = nil end #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize super(0, 0) select_last end #-------------------------------------------------------------------------- # ● 获取窗口的宽度 #-------------------------------------------------------------------------- def window_width return 800 end def window_height return 48 end def col_max return 6 end #-------------------------------------------------------------------------- # ● 获取显示行数 #-------------------------------------------------------------------------- def visible_line_number item_max end #-------------------------------------------------------------------------- # ● 生成指令列表 #-------------------------------------------------------------------------- def make_command_list add_main_commands add_formation_command add_original_commands add_save_command add_game_end_command end #-------------------------------------------------------------------------- # ● 向指令列表添加主要的指令 #-------------------------------------------------------------------------- def add_main_commands add_command(Vocab::item, :item, main_commands_enabled) add_command(Vocab::skill, :skill, main_commands_enabled) add_command(Vocab::equip, :equip, main_commands_enabled) add_command(Vocab::status, :status, main_commands_enabled) end #-------------------------------------------------------------------------- # ● 添加整队指令 #-------------------------------------------------------------------------- def add_formation_command add_command(Vocab::formation, :formation, formation_enabled) end #-------------------------------------------------------------------------- # ● 独自添加指令用 #-------------------------------------------------------------------------- def add_original_commands end #-------------------------------------------------------------------------- # ● 添加存档指令 #-------------------------------------------------------------------------- def add_save_command add_command(Vocab::save, :save, save_enabled) end #-------------------------------------------------------------------------- # ● 添加游戏结束指令 #-------------------------------------------------------------------------- def add_game_end_command add_command(Vocab::game_end, :game_end) end #-------------------------------------------------------------------------- # ● 获取主要指令的有效状态 #-------------------------------------------------------------------------- def main_commands_enabled $game_party.exists end #-------------------------------------------------------------------------- # ● 获取整队的有效状态 #-------------------------------------------------------------------------- def formation_enabled $game_party.members.size >= 2 && !$game_system.formation_disabled end #-------------------------------------------------------------------------- # ● 获取存档的有效状态 #-------------------------------------------------------------------------- def save_enabled !$game_system.save_disabled end #-------------------------------------------------------------------------- # ● 按下确定键时的处理 #-------------------------------------------------------------------------- def process_ok @@last_command_symbol = current_symbol super end #-------------------------------------------------------------------------- # ● 返回最后一个选项的位置 #-------------------------------------------------------------------------- def select_last select_symbol(@@last_command_symbol) end end
#encoding:utf-8
#==============================================================================
# ■ Window_MenuCommand
#------------------------------------------------------------------------------
# 菜单画面中显示指令的窗口
#==============================================================================
class Window_MenuCommand < Window_HorzCommand
#--------------------------------------------------------------------------
# ● 初始化指令选择位置(类方法)
#--------------------------------------------------------------------------
def self.init_command_position
@@last_command_symbol = nil
end
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize
super(0, 0)
select_last
end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
return 800
end
def window_height
return 48
end
def col_max
return 6
end
#--------------------------------------------------------------------------
# ● 获取显示行数
#--------------------------------------------------------------------------
def visible_line_number
item_max
end
#--------------------------------------------------------------------------
# ● 生成指令列表
#--------------------------------------------------------------------------
def make_command_list
add_main_commands
add_formation_command
add_original_commands
add_save_command
add_game_end_command
end
#--------------------------------------------------------------------------
# ● 向指令列表添加主要的指令
#--------------------------------------------------------------------------
def add_main_commands
add_command(Vocab::item, :item, main_commands_enabled)
add_command(Vocab::skill, :skill, main_commands_enabled)
add_command(Vocab::equip, :equip, main_commands_enabled)
add_command(Vocab::status, :status, main_commands_enabled)
end
#--------------------------------------------------------------------------
# ● 添加整队指令
#--------------------------------------------------------------------------
def add_formation_command
add_command(Vocab::formation, :formation, formation_enabled)
end
#--------------------------------------------------------------------------
# ● 独自添加指令用
#--------------------------------------------------------------------------
def add_original_commands
end
#--------------------------------------------------------------------------
# ● 添加存档指令
#--------------------------------------------------------------------------
def add_save_command
add_command(Vocab::save, :save, save_enabled)
end
#--------------------------------------------------------------------------
# ● 添加游戏结束指令
#--------------------------------------------------------------------------
def add_game_end_command
add_command(Vocab::game_end, :game_end)
end
#--------------------------------------------------------------------------
# ● 获取主要指令的有效状态
#--------------------------------------------------------------------------
def main_commands_enabled
$game_party.exists
end
#--------------------------------------------------------------------------
# ● 获取整队的有效状态
#--------------------------------------------------------------------------
def formation_enabled
$game_party.members.size >= 2 && !$game_system.formation_disabled
end
#--------------------------------------------------------------------------
# ● 获取存档的有效状态
#--------------------------------------------------------------------------
def save_enabled
!$game_system.save_disabled
end
#--------------------------------------------------------------------------
# ● 按下确定键时的处理
#--------------------------------------------------------------------------
def process_ok
@@last_command_symbol = current_symbol
super
end
#--------------------------------------------------------------------------
# ● 返回最后一个选项的位置
#--------------------------------------------------------------------------
def select_last
select_symbol(@@last_command_symbol)
end
end
然后修改Scene_Menu,直接替换。
#encoding:utf-8 #============================================================================== # ■ Scene_Menu #------------------------------------------------------------------------------ # 菜单画面 #============================================================================== class Scene_Menu < Scene_MenuBase #-------------------------------------------------------------------------- # ● 开始处理 #-------------------------------------------------------------------------- def start super create_command_window create_mgold_window create_status_window end #-------------------------------------------------------------------------- # ● 生成指令窗口 #-------------------------------------------------------------------------- def create_command_window @command_window = Window_MenuCommand.new @command_window.set_handler(:item, method(:command_item)) @command_window.set_handler(:skill, method(:command_personal)) @command_window.set_handler(:equip, method(:command_personal)) @command_window.set_handler(:status, method(:command_personal)) @command_window.set_handler(:formation, method(:command_formation)) @command_window.set_handler(:save, method(:command_save)) @command_window.set_handler(:game_end, method(:command_game_end)) @command_window.set_handler(:cancel, method(:return_scene)) end #-------------------------------------------------------------------------- # ● 生成金钱窗口 #-------------------------------------------------------------------------- def create_mgold_window @gold_window = Window_MGold.new @gold_window.x = 0 @gold_window.y = Graphics.height - 48 @ver_window = Window_ver.new @ver_window.x = Graphics.width - 250 @ver_window.y = Graphics.height - 48 @map_window = Window_Map.new @map_window.x = Graphics.width - 550 @map_window.y = Graphics.height - 48 end #-------------------------------------------------------------------------- # ● 生成状态窗口 #-------------------------------------------------------------------------- def create_status_window @status_window = Window_MenuStatus.new(@command_window.width, 0) end #-------------------------------------------------------------------------- # ● 指令“物品” #-------------------------------------------------------------------------- def command_item SceneManager.call(Scene_Item) end #-------------------------------------------------------------------------- # ● 指令“技能”“装备”“状态” #-------------------------------------------------------------------------- def command_personal @status_window.select_last @status_window.activate @status_window.set_handler(:ok, method(:on_personal_ok)) @status_window.set_handler(:cancel, method(:on_personal_cancel)) end #-------------------------------------------------------------------------- # ● 指令“整队” #-------------------------------------------------------------------------- def command_formation @status_window.select_last @status_window.activate @status_window.set_handler(:ok, method(:on_formation_ok)) @status_window.set_handler(:cancel, method(:on_formation_cancel)) end #-------------------------------------------------------------------------- # ● 指令“存档” #-------------------------------------------------------------------------- def command_save SceneManager.call(Scene_Save) end #-------------------------------------------------------------------------- # ● 指令“结束游戏” #-------------------------------------------------------------------------- def command_game_end SceneManager.call(Scene_End) end #-------------------------------------------------------------------------- # ● 个人指令“确定” #-------------------------------------------------------------------------- def on_personal_ok case @command_window.current_symbol when :skill SceneManager.call(Scene_Skill) when :equip SceneManager.call(Scene_Equip) when :status SceneManager.call(Scene_Status) end end #-------------------------------------------------------------------------- # ● 个人指令“取消” #-------------------------------------------------------------------------- def on_personal_cancel @status_window.unselect @command_window.activate end #-------------------------------------------------------------------------- # ● 整队“确定” #-------------------------------------------------------------------------- def on_formation_ok if @status_window.pending_index >= 0 $game_party.swap_order(@status_window.index, @status_window.pending_index) @status_window.pending_index = -1 @status_window.redraw_item(@status_window.index) else @status_window.pending_index = @status_window.index end @status_window.activate end #-------------------------------------------------------------------------- # ● 整队“取消” #-------------------------------------------------------------------------- def on_formation_cancel if @status_window.pending_index >= 0 @status_window.pending_index = -1 @status_window.activate else @status_window.unselect @command_window.activate end end end
#encoding:utf-8
#==============================================================================
# ■ Scene_Menu
#------------------------------------------------------------------------------
# 菜单画面
#==============================================================================
class Scene_Menu < Scene_MenuBase
#--------------------------------------------------------------------------
# ● 开始处理
#--------------------------------------------------------------------------
def start
super
create_command_window
create_mgold_window
create_status_window
end
#--------------------------------------------------------------------------
# ● 生成指令窗口
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_MenuCommand.new
@command_window.set_handler(:item, method(:command_item))
@command_window.set_handler(:skill, method(:command_personal))
@command_window.set_handler(:equip, method(:command_personal))
@command_window.set_handler(:status, method(:command_personal))
@command_window.set_handler(:formation, method(:command_formation))
@command_window.set_handler(:save, method(:command_save))
@command_window.set_handler(:game_end, method(:command_game_end))
@command_window.set_handler(:cancel, method(:return_scene))
end
#--------------------------------------------------------------------------
# ● 生成金钱窗口
#--------------------------------------------------------------------------
def create_mgold_window
@gold_window = Window_MGold.new
@gold_window.x = 0
@gold_window.y = Graphics.height - 48
@ver_window = Window_ver.new
@ver_window.x = Graphics.width - 250
@ver_window.y = Graphics.height - 48
@map_window = Window_Map.new
@map_window.x = Graphics.width - 550
@map_window.y = Graphics.height - 48
end
#--------------------------------------------------------------------------
# ● 生成状态窗口
#--------------------------------------------------------------------------
def create_status_window
@status_window = Window_MenuStatus.new(@command_window.width, 0)
end
#--------------------------------------------------------------------------
# ● 指令“物品”
#--------------------------------------------------------------------------
def command_item
SceneManager.call(Scene_Item)
end
#--------------------------------------------------------------------------
# ● 指令“技能”“装备”“状态”
#--------------------------------------------------------------------------
def command_personal
@status_window.select_last
@status_window.activate
@status_window.set_handler(:ok, method(:on_personal_ok))
@status_window.set_handler(:cancel, method(:on_personal_cancel))
end
#--------------------------------------------------------------------------
# ● 指令“整队”
#--------------------------------------------------------------------------
def command_formation
@status_window.select_last
@status_window.activate
@status_window.set_handler(:ok, method(:on_formation_ok))
@status_window.set_handler(:cancel, method(:on_formation_cancel))
end
#--------------------------------------------------------------------------
# ● 指令“存档”
#--------------------------------------------------------------------------
def command_save
SceneManager.call(Scene_Save)
end
#--------------------------------------------------------------------------
# ● 指令“结束游戏”
#--------------------------------------------------------------------------
def command_game_end
SceneManager.call(Scene_End)
end
#--------------------------------------------------------------------------
# ● 个人指令“确定”
#--------------------------------------------------------------------------
def on_personal_ok
case @command_window.current_symbol
when :skill
SceneManager.call(Scene_Skill)
when :equip
SceneManager.call(Scene_Equip)
when :status
SceneManager.call(Scene_Status)
end
end
#--------------------------------------------------------------------------
# ● 个人指令“取消”
#--------------------------------------------------------------------------
def on_personal_cancel
@status_window.unselect
@command_window.activate
end
#--------------------------------------------------------------------------
# ● 整队“确定”
#--------------------------------------------------------------------------
def on_formation_ok
if @status_window.pending_index >= 0
$game_party.swap_order(@status_window.index,
@status_window.pending_index)
@status_window.pending_index = -1
@status_window.redraw_item(@status_window.index)
else
@status_window.pending_index = @status_window.index
end
@status_window.activate
end
#--------------------------------------------------------------------------
# ● 整队“取消”
#--------------------------------------------------------------------------
def on_formation_cancel
if @status_window.pending_index >= 0
@status_window.pending_index = -1
@status_window.activate
else
@status_window.unselect
@command_window.activate
end
end
end
请注意,要添加一下字体
"Old English Text MT"
"华康雅宋体W9(P)"
然后在Graphics里面建立文件夹HalfBody,添加和主人公头像同名的文件,大小是136*280.
例如
对了,要替换一个破除分辨率限制的dll
这样子一个800*480的系统就完成了~
大召唤术
@迷糊的安安 @怪蜀黍 @进击の虎叔 @柳泖 @MeowSnow @片翼贤者 @ナイフ君 @VIPArcher @cinderelmini @樱花树下
PS由于发现800*480分辨率使用较少,特在此推出通用版本的系统范例,可以直接点击下载。分辨率设置完成后可以自动适应。但是如果需要比较好的效果还需要自行修改一下~
http://pan.baidu.com/s/1jG7Pe8A |
评分
-
查看全部评分
|