| 赞 | 72 |
| VIP | |
| 好人卡 | |
| 积分 | 23 |
| 经验 | |
| 最后登录 | 2022-3-9 |
| 在线时间 | 4033 小时 |
…あたしは天
- 梦石
- 0
- 星屑
- 2308
- 在线时间
- 4033 小时
- 注册时间
- 2010-10-4
- 回帖
- 10548
 
|
发表于 2014-5-1 14:56:54
|
显示全部楼层
试着只用脚本编辑器写了一下,结果就是个杯具
所以说这种东西应该不太能只用RGSS3来实现吧……
然后送一段杯具的代码=。=
[pre lang="ruby" line="1"]
class Font
attr_accessor :outline_size
singleton_class.send :attr_accessor, :default_outline_size
self.default_outline_size = 1
alias initialize_without_outline initialize
def initialize(*args)
initialize_without_outline(*args)
@outline_size = Font.default_outline_size
end
end
class Bitmap
alias draw_text_without_outline draw_text
def draw_text(*args)
draw_text_without_outline(*args)
return unless font.outline_size
white = Color.new(255,255,255)
temp = Bitmap.new(width, height)
temp.fill_rect(0, 0, width, height, white)
temp.draw_text_without_outline(*args)
width.times do |x|
height.times do |y|
unless temp.get_pixel(x, y) == white
(x - font.outline_size + 1).upto(x + font.outline_size - 1) do |i|
(y - font.outline_size + 1).upto(y + font.outline_size - 1) do |j|
set_pixel(i, j, font.out_color)
end
end
end
end
end
temp.dispose
end
end
[/pre] |
|