Project1

标题: 求助。这个阴影脚本该如何使用 [打印本页]

作者: 菊花侠小赵    时间: 2014-10-12 22:54
标题: 求助。这个阴影脚本该如何使用
  1. #======================================================================
  2. # 脚本来自www.66rpg.com,使用请保留此信息
  3. # 作者:SailCat;升级:柳柳;最后升级日期:2006年4月30日
  4. #======================================================================
  5. class Bitmap
  6.   unless $OK
  7.     alias sailcat_draw_text draw_text
  8.     def draw_text(p1, p2, p3 = 0, p4 = 3, p5 = nil, p6 = 0, p7 = 3, p8 = nil)
  9.       case p1
  10.       when Numeric
  11.         x = p1
  12.         y = p2
  13.         width = p3
  14.         height = p4
  15.         text = p5
  16.         align = p6
  17.         shadow_direction = p7
  18.         shadow_color = p8
  19.         if shadow_color.nil?
  20.           shadow_color = Color.new(0, 0, 0, self.font.color.alpha * 0.99)
  21.         end
  22.       when Rect
  23.         x = p1.x
  24.         y = p1.y
  25.         width = p1.width
  26.         height = p1.height
  27.         text = p2
  28.         align = p3
  29.         shadow_direction = p4
  30.         shadow_color = p5
  31.         if shadow_color.nil?
  32.           shadow_color = Color.new(0, 0, 0, self.font.color.alpha * 0.99)
  33.         end
  34.       end
  35.       color_temp = self.font.color.clone
  36.       if shadow_direction != 0
  37.         self.font.color = shadow_color
  38.         case shadow_direction
  39.         when 1
  40.          sailcat_draw_text(x-1, y+1, width, height, text, align)
  41.         when 3
  42.          sailcat_draw_text(x+1, y+1, width, height, text, align)
  43.         when 7
  44.          sailcat_draw_text(x-1, y-1, width, height, text, align)
  45.         when 9
  46.          sailcat_draw_text(x+1, y-1, width, height, text, align)
  47.         end
  48.         self.font.color = color_temp
  49.       end
  50.       $OK = true
  51.       sailcat_draw_text(x, y, width, height, text, align)
  52.     end
  53.   end
  54. end
复制代码

作者: 你最珍贵    时间: 2014-10-13 12:50
main前面插入




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