じ☆ve冰风 发表于 2024-4-19 19:36:40

ISA - 描绘模糊文字 - Blur Draw Text

#______________________________________________________________________________# * 此脚本归66RPG - Idiot Script Association(ISA)所有,谢绝任何形式转载。#______________________________________________________________________________#==============================================================================# ■ 描绘模糊文字 - Blur Draw Text#------------------------------------------------------------------------------#   遵守协议:66RPG - Idiot Script Association(ISA)#   当前版本:1.0.0.4#------------------------------------------------------------------------------#   更新日记:忧雪の伤(2011.5.6)#             - 优化处理#==============================================================================#--------------------------------------------------------------------------# ● 资料记录#--------------------------------------------------------------------------module ISA   Use["描绘模糊文字"] = end#==============================================================================# ■ Bitmap#------------------------------------------------------------------------------#   位图的类。所谓位图即表示图像其本身。#==============================================================================class Bitmap#--------------------------------------------------------------------------# ● 描绘模糊文字#--------------------------------------------------------------------------def blur_draw_text(x, y, width, height, str, align = 0, edge_color = , edge_size = 1, blur_size = 2)    original_color =     font.color.set(edge_color, edge_color, edge_color, edge_color.nil? ? 255 : edge_color)    for x_plus in -edge_size..edge_size;for y_plus in -edge_size..edge_size      next if x_plus.zero? and y_plus.zero?       draw_text(x + x_plus, y + y_plus, width, height, str, align)    end;end    blur(blur_size, Rect.new(x, y, width + font.size, height + font.size)) unless blur_size.nil? or blur_size.zero?    font.color.set(original_color, original_color, original_color, original_color)    draw_text(x, y, width, height, str, align)endend复制代码
更新截图:

截图二号:
https://rpg.blue/data/attachment/forum/201105/08/094326rr5drlnvqfbqvdjl.jpg
             本帖来自P1论坛作者忧雪の伤,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=168157若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
页: [1]
查看完整版本: ISA - 描绘模糊文字 - Blur Draw Text