| 
 
| 赞 | 3 |  
| VIP | 109 |  
| 好人卡 | 208 |  
| 积分 | 3 |  
| 经验 | 22037 |  
| 最后登录 | 2025-4-27 |  
| 在线时间 | 1196 小时 |  
 Lv2.观梦者 虚構歪曲
	梦石0 星屑334 在线时间1196 小时注册时间2010-12-18帖子3928 
 | 
| 
本帖最后由 忧雪の伤 于 2011-8-12 00:42 编辑
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  
 适用范围:VXP(VX & XP)。
 使用说明:使用说明参见脚本中的注释部分。
 
 
 复制代码
#==============================================================================
#  Chinese name: 描绘字符扩张  
#  English name: Expansion of Text Drawing
#------------------------------------------------------------------------------
#  Pact: Idiot Script Association(ISA)
#  Website: http://rpg.blue/group-215-1.html
#------------------------------------------------------------------------------
#  Author: 忧雪の伤
#  Version: 1.0.1.0
#  Update: 2011.8.11
#==============================================================================
#==============================================================================
# ** Take down this script's message.
#------------------------------------------------------------------------------
#    记录这个脚本的信息。
#==============================================================================
$imported = {} if $imported.nil?
$imported['DrawingTextEx'] = '1.0.1.0'
#==============================================================================
# ** Bitmap
#==============================================================================
class Bitmap
  #--------------------------------------------------------------------------
  # * Draw text and blur outline.
  #--------------------------------------------------------------------------
  #   描绘具有模糊边缘的文字。
  #--------------------------------------------------------------------------
  #   blur_draw_text(x, y, width, height, str[, align, outline_color,
  #                        outline_size, blur_strength, blur_opacity])
  #
  #   blur_draw_text(rect, str[, align, outline_color, outline_size, 
  #                        blur_strength, blur_opacity])
  #
  #     outline_color : 边缘的颜色(Color)。
  #     outline_size : 边缘的大小(Integer)。
  #     blur_strength : 模糊的强度(Integer)。
  #     blur_opacity : 模糊的不透明度(Fixnum)。 
  #--------------------------------------------------------------------------
  def blur_draw_text(*args)
    if args[0].is_a?(Rect)
      x = args[0].x 
      y = args[0].y
      width = args[0].width
      height = args[0].height
      return blur_draw_text(x, y, width, height, *args[1, 5])
    end
    args[5] = 0 if args[5].nil? 
    args[6] = Color.new(255, 255, 255) if args[6].nil? 
    args[7] = 0 if args[7].nil? 
    args[8] = 2 if args[8].nil? 
    args[9] = 10 if args[9].nil? 
    color = font.color.clone
    font.color = args[6]
    (-args[7]).upto(args[7]) do |x| 
      (-args[7]).upto(args[7]) do |y|
        draw_text(args[0] + x, args[1] + y, *args[2, 4])
      end
    end
    rect = text_size(args[4])
    x_plus, y_plus = [args[0], (args[2] - rect.width) / 2 + args[0], 
    args[2] - rect.width + args[0]], (args[3] - rect.height) / 2 + args[1]
    (-args[8]).upto(args[8]) do |x| 
      (-args[8]).upto(args[8]) do |y|
        next if x.zero? and y.zero?
        src_rect = Rect.new(x_plus[args[5]], y_plus, rect.width, rect.height)
        blt(x_plus[args[5]] + x, y_plus + y, self, src_rect, args[9])
      end
    end
    font.color = color
    draw_text(*args[0, 6])
  end
  #--------------------------------------------------------------------------
  # * Draw text and outline.
  #--------------------------------------------------------------------------
  #   描绘具有边缘的文字。
  #--------------------------------------------------------------------------
  #   outline_draw_text(x, y, width, height, str[, align, outline_color,
  #                     outline_size])
  #
  #   outline_draw_text(rect, str[, align, outline_color, outline_size])
  #
  #     outline_color : 边缘的颜色(Color)。
  #     outline_size : 边缘的大小(Integer)。 
  #--------------------------------------------------------------------------
  def outline_draw_text(*args)
    if args[0].is_a?(Rect)
      x = args[0].x 
      y = args[0].y
      width = args[0].width
      height = args[0].height
      return fade_draw_text(x, y, width, height, *args[1, 3])
    end
    args[5] = 0 if args[5].nil? 
    args[6] = Color.new(0, 0, 0) if args[6].nil? 
    args[7] = 1 if args[7].nil? 
    color = font.color.clone
    font.color = args[6]
    (-args[7]).upto(args[7]) do |x| 
      (-args[7]).upto(args[7]) do |y| 
        next if x.zero? and y.zero?
        draw_text(args[0] + x, args[1] + y, *args[2, 4])
      end
    end
    font.color = color
    draw_text(*args[0, 6])
  end
end
 | 
 |