只做了窗口的类,如果想要显示的话,请在对应的场景生成它。坐标自己调节就好。
如果相应位置的变量=0,那么这个位置就会空出来。显示“无装备”。
本窗口只具有显示功能,而不具有选择功能。
class Window_Weapon < Window_Base def initialize super(0, 0, 256, 352) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear (0...10).each do |i| weapon = $data_weapons[$game_variables[i+1]] if weapon != nil draw_item_name(weapon, 4, i * 32) else self.contents.draw_text(4, i * 32, width - 32, 32, "[无装备]") end end end end
class Window_Weapon < Window_Base
def initialize
super(0, 0, 256, 352)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
(0...10).each do |i|
weapon = $data_weapons[$game_variables[i+1]]
if weapon != nil
draw_item_name(weapon, 4, i * 32)
else
self.contents.draw_text(4, i * 32, width - 32, 32, "[无装备]")
end
end
end
end
|