Project1

标题: 如何呼出窗口? [打印本页]

作者: zhouzhuofan1    时间: 2013-10-20 11:43
标题: 如何呼出窗口?
  1. class Window_zczt < Window_Base
  2.   def initialize
  3.     super(0,0,640,480)
  4.     self.contents = Bitmap.new(width-32,height-32)
  5.     self.contents.font.color = Color.new(105,255,150)
  6.     refresh
  7.   end
  8.   def refresh
  9.     self.contents.clear
  10.     bitmap = Bitmap.new('Graphics/Faces/阿尔西斯头像.png')
  11.     rect = Rect.new(0,0,bitmap.width,bitmap.height)
  12.     self.contents.blt(6,13,bitmap,rect)
  13.     w = 22
  14.     h = 22
  15.     self.contents.font.color = Color.new(235,5,4)
  16.     self.contents.draw_text(143,31,w,h,'HP')
  17.     bitmap = Bitmap.new('Graphics/Faces/塞尔维亚头像.png')
  18.     rect = Rect.new(0,0,bitmap.width,bitmap.height)
  19.     self.contents.blt(341,25,bitmap,rect)
  20.     self.contents.draw_text(486,37,w,h,'HP')
  21.     w = 275
  22.     self.contents.font.color = Color.new(254,255,255)
  23.     self.contents.draw_text(180,33,w,h,$game_variables[100].to_s)
  24.     w = 286
  25.     self.contents.draw_text(523,39,w,h,$game_variables[55].to_s)
  26.   end
  27. end
复制代码
如何呼出这个窗口?
作者: yagami    时间: 2013-10-20 11:46
Window_zczt.new  但这样由于RUBY自动释放内存很快就消失的  给个变量 a=Window_zczt.new  这样引用计数就加1了 a存在的话 那个new出来的不会消失




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1