本帖最后由 delv25 于 2013-8-10 22:17 编辑
用图片比较方便……
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(149,475,360)#在此修改图标,第一个数字是图标编号,其余的分别为xy坐标
self.contents.draw_text(480, 360, 60, WLH, $game_variables[1],1) #变量的显示,前面的两个为xy坐标, $game_variables[变量ID]
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
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(149,475,360)#在此修改图标,第一个数字是图标编号,其余的分别为xy坐标
self.contents.draw_text(480, 360, 60, WLH, $game_variables[1],1) #变量的显示,前面的两个为xy坐标, $game_variables[变量ID]
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
|