正确的做法是改Scene_Title的三个地方,第一个就是update方法
[pre lang="Ruby"] def update
# Update command window
@command_window.update
if @command_window.active
update_command
return
end
if @about
update_about
return
end
end
[/pre]
这里的update需要判断刷新的内容,然后分别执行刷新的操作。
第二个地方就是要新加入这个方法:
[pre lang="Ruby"] def update_command
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # New game
command_new_game
when 1 # Continue
command_continue
when 2 # Shutdown
command_shutdown
end
end
end[/pre]
这个方法的作用其实是将原来的update拆开,这样方便代码的管理。在这里你需要把调用command_about的命令加在合适的位置上。