我上次发布的脚本似乎没有伯乐发现他是千里马,于是本人亲自上阵。 
http://rpg.blue/forum.php?mod=vi ... 8&fromuid=61278
本系统同样具有超强的适应能力,请看下图:
 
缩放窗口
 
缩放窗口,到达屏幕边缘自动停止缩放。
 
缩放字体
 
人类看不清的字也可以显示:
 
设置: 
第41行,设置信息窗口弹出后等待的时间。 
第53、54行,设置窗口每次不透明度减少的量。 
其他的,自己看。=_= - def print(*args)  if $print_message == true    $print_window.dispose  end  # 生成系统对像  $game_system = Game_System.new unless $game_system  $data_system        = load_data("Data/System.rxdata") unless $data_system  message = args.to_s  message = message + "\r\n"  bitmap = Bitmap.new(608,448)  line_all = 0  pos1 = 0  pos2 = 0  array = []  loop do    pos2 = message.index("\n", pos1)    if pos2      array.push(bitmap.text_size(message[pos1, pos2]).width)      pos1 = pos2 + 1      line_all += 1    else      break    end  end  if array.max > 608    rect_width = 608  else    rect_width = array.max  end  if line_all > 14    rect_height = 14 * 32  else    rect_height = line_all * 32  end  $print_window = Window_Base.new(320 - (rect_width + 32) / 2, 240 - (rect_height + 32) / 2, rect_width + 32, rect_height + 32)  $print_window.z = 99998 # 这里比鼠标的z值小。  $print_window.back_opacity = 160  $print_window.contents = Bitmap.new(rect_width, rect_height)  $print_window.contents.font.bold = true  $print_window.contents.font.color = $print_window.crisis_color  $print_window.contents.draw_text_all(0, 0, rect_width, rect_height, args.to_s, 1)  for i in 0...120 # 这里设置等待时间    Graphics.update    Input.update    break if Input.trigger?(Input::C)  end  $print_message = trueendclass  96        self.font.size = 96      elsif size < 6        self.font.size = 6      else        self.font.size = size      end    end    # 描绘目标    for j in 0...s.size      draw_text(x, height / line_all.to_f * j + y, width, height / line_all.to_f, s[j], align)    end  endend复制代码
 
  复制代码             本帖来自P1论坛作者谢谢合作,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址: https://rpg.blue/forum.php?mod=viewthread&tid=142008  若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。  |