Project1
标题: 怎么写开关脚本【地图显示变量】 [打印本页]
作者: 黑之翅膀 时间: 2011-10-21 23:24
标题: 怎么写开关脚本【地图显示变量】
请问怎么写开关脚本?
我想在这个脚本里加个开关 打开[n]号开关开启,关闭则不显示- class Window_hpWindow < Window_Base
- def initialize
- super(0,0,600,600)
- self.opacity = 0
- self.visible = false
- refresh
- end
- def refresh
- self.contents.clear
- draw_icon(498,0,0)#在此修改图标,第一个数字是图标编号
- self.contents.draw_text(20, 0, 60, WLH, $game_variables[9],2)
- draw_icon(504,0,20)#在此修改图标,第一个数字是图标编号
- self.contents.draw_text(20, 20, 60, WLH, $game_variables[10],2)
- end
- end
- class Scene_Map < Scene_Base
- alias hpWindow_start start
- alias hpWindow_update
- update
- alias hpWindow_terminate terminate
- def start
- hpWindow_start
- @hpWindow = Window_hpWindow.new
- end
- def update
- #@hpWindow.update
- @hpWindow.refresh
- @hpWindow.visible = true
- hpWindow_update
- end
- def terminate
- hpWindow_terminate
- @hpWindow.dispose
- end
- end
复制代码