| 赞 | 46 |
| VIP | |
| 好人卡 | |
| 积分 | 97 |
| 经验 | |
| 最后登录 | 2026-6-17 |
| 在线时间 | 2775 小时 |
梦石0
星屑9716
在线时间2775 小时
注册时间2008-9-5
回帖3458
   
|
发表于 2014-11-2 00:14:24
|
显示全部楼层
本帖最后由 cinderelmini 于 2014-11-2 00:22 编辑
- #======================================================================
- # 脚本来自[url]www.66rpg.com[/url],使用请保留此信息
- # 作者:SailCat;升级:柳柳;最后升级日期:2006年4月30日
- #======================================================================
- class Bitmap
- unless $OK
- alias sailcat_draw_text draw_text
- def draw_text(p1, p2, p3 = 0, p4 = 3, p5 = nil, p6 = 0, p9 = false, p7 = 3, p8 = nil)
- case p1
- when Numeric
- x = p1
- y = p2
- width = p3
- height = p4
- text = p5
- align = p6
- shadow_direction = p7
- shadow_color = p8
- if shadow_color.nil?
- shadow_color = Color.new(0, 0, 0, self.font.color.alpha * 0.99)
- end
- when Rect
- x = p1.x
- y = p1.y
- width = p1.width
- height = p1.height
- text = p2
- align = p3
- shadow_direction = p4
- shadow_color = p5
- if shadow_color.nil?
- shadow_color = Color.new(0, 0, 0, self.font.color.alpha * 0.99)
- end
- end
- if p9
- sailcat_draw_text(x, y, width, height, text, align)
- return
- end
- color_temp = self.font.color.clone
- if shadow_direction != 0
- self.font.color = shadow_color
- case shadow_direction
- when 1
- sailcat_draw_text(x-1, y+1, width, height, text, align)
- when 3
- sailcat_draw_text(x+1, y+1, width, height, text, align)
- when 7
- sailcat_draw_text(x-1, y-1, width, height, text, align)
- when 9
- sailcat_draw_text(x+1, y-1, width, height, text, align)
- end
- self.font.color = color_temp
- end
- $OK = true
- sailcat_draw_text(x, y, width, height, text, align)
- end
- end
- end
复制代码 把参数加上去了,
使用的话,比如- self.contents.draw_text(x, y, width, height, text, align, 是否影子, 影子方向, 影子颜色)
复制代码 注:是否影子就是true/false,影子方向参考数字小键盘填对应数字,颜色填nil就是默认黑色(后面两者可不填)。
但是,改影子是否可见的话,必须填对齐(0/1/2→左/中/右)。 |
评分
-
查看全部评分
|