如果你说的"说明窗口"是指Window_Help的话, 用纯事件应该是无法实现的...
脚本的解決方案, 随便搜一搜应该都有十个八个吧...
我就写个简陋的你看看能用不...
module HELP_WINDOW REGION_ID = 1 #踏入此ID的区域时显示帮助窗口 TEXT_VAR = 1 #此ID的变量用于儲存帮助窗口的內容 LINE_HEIGHT = 1 #帮助窗口的行数, 如果设成2+, 那內容如何换行我就不知道了~~ end class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # ● 更新画面 #-------------------------------------------------------------------------- alias update_with_help_window update def update update_with_help_window unless @help_window_text == help_window_text @help_window_text = help_window_text @help_window.set_text(@help_window_text) end if $game_map.region_id($game_player.x, $game_player.y) == HELP_WINDOW::REGION_ID && !@help_window_text.empty? @help_window.visible = true elsif @help_window.visible == true @help_window.visible = false $game_variables[HELP_WINDOW::TEXT_VAR] = "" end end #-------------------------------------------------------------------------- # ● 生成所有窗口 #-------------------------------------------------------------------------- alias create_all_windows_with_help_window create_all_windows def create_all_windows create_all_windows_with_help_window create_help_window end #-------------------------------------------------------------------------- # ● 生成帮助窗口 #-------------------------------------------------------------------------- def create_help_window @help_window = Window_Help.new(HELP_WINDOW::LINE_HEIGHT) @help_window.visible = false end #-------------------------------------------------------------------------- # ● 获取帮助窗口的文本 #-------------------------------------------------------------------------- def help_window_text return $game_variables[HELP_WINDOW::TEXT_VAR] == 0 ? "" : $game_variables[1].to_s end end
module HELP_WINDOW
REGION_ID = 1 #踏入此ID的区域时显示帮助窗口
TEXT_VAR = 1 #此ID的变量用于儲存帮助窗口的內容
LINE_HEIGHT = 1 #帮助窗口的行数, 如果设成2+, 那內容如何换行我就不知道了~~
end
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# ● 更新画面
#--------------------------------------------------------------------------
alias update_with_help_window update
def update
update_with_help_window
unless @help_window_text == help_window_text
@help_window_text = help_window_text
@help_window.set_text(@help_window_text)
end
if $game_map.region_id($game_player.x, $game_player.y) == HELP_WINDOW::REGION_ID && !@help_window_text.empty?
@help_window.visible = true
elsif @help_window.visible == true
@help_window.visible = false
$game_variables[HELP_WINDOW::TEXT_VAR] = ""
end
end
#--------------------------------------------------------------------------
# ● 生成所有窗口
#--------------------------------------------------------------------------
alias create_all_windows_with_help_window create_all_windows
def create_all_windows
create_all_windows_with_help_window
create_help_window
end
#--------------------------------------------------------------------------
# ● 生成帮助窗口
#--------------------------------------------------------------------------
def create_help_window
@help_window = Window_Help.new(HELP_WINDOW::LINE_HEIGHT)
@help_window.visible = false
end
#--------------------------------------------------------------------------
# ● 获取帮助窗口的文本
#--------------------------------------------------------------------------
def help_window_text
return $game_variables[HELP_WINDOW::TEXT_VAR] == 0 ? "" : $game_variables[1].to_s
end
end
|