# 新建窗口
class Window_Variables < Window_Base
# 初始化
def initialize
# 创建大小
super(0,360,128,56)
# 获取图标编号
@icon = 0
# 获取变量编号
@variable = 0
# 刷新
refresh
# 初始化结束
end
# 刷新
def refresh
# 在图表与变量都有变化的情况下
if @icon != $icon_index or @variable != $game_variables[$variables_id]
# 清楚内容
self.contents.clear
# 描绘图表
draw_icon($icon_index,40,0,true)
# 描绘变量,偏右
self.contents.draw_text(32,0,64,24,$game_variables[$variables_id].to_s,2)
# 带入变量
@icon = $icon_index
@variable = $game_variables[$variables_id]
# if 结束
end
# 刷新结束
end
# class 结束
end
# 地图生成窗口
class Scene_Map < Scene_Base
# 生成窗口
alias new_start start
def start
new_start
@varia_window = Window_Variables.new
end
# 刷新窗口
alias new_update update
def update
new_update
@varia_window.refresh
end
# 释放窗口
alias new_terminate terminate
def terminate
@varia_window.dispose
new_terminate
end
# class 结束
end
这个效果就是在地图上显示变量,如果我想扩充这个脚本,让他同时显示多个变量,要怎么修改?
if @icon != $icon_index or $game_variables[Vwod1] != $game_variables[Vwos1] or $game_variables[Vwod2] != $game_variables[Vwos2] or $game_variables[Vwod3] != $game_variables[Vwos3] or $game_variables[Vwod4] != $game_variables[Vwos4]
if @icon != $icon_index or $game_variables[Vwod1] != $game_variables[Vwos1] or $game_variables[Vwod2] != $game_variables[Vwos2] or $game_variables[Vwod3] != $game_variables[Vwos3] or $game_variables[Vwod4] != $game_variables[Vwos4]