赞 | 23 |
VIP | 207 |
好人卡 | 31 |
积分 | 31 |
经验 | 48797 |
最后登录 | 2024-5-11 |
在线时间 | 1535 小时 |
Lv3.寻梦者 孤独守望
- 梦石
- 0
- 星屑
- 3132
- 在线时间
- 1535 小时
- 注册时间
- 2006-10-16
- 帖子
- 4321
|
没有描边字?打开一个默认工程就有……
XP- class RPG::Sprite
- def damage(value, critical)
- dispose_damage
- if value.is_a?(Numeric)
- damage_string = value.abs.to_s
- else
- damage_string = value.to_s
- end
- bitmap = Bitmap.new(160, 48)
- bitmap.font.name = "Arial Black"
- bitmap.font.size = 32
- bitmap.font.color.set(0, 0, 0)
- bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
- bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
- bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
- bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
- if value.is_a?(Numeric) and value < 0
- bitmap.font.color.set(176, 255, 144)
- else
- bitmap.font.color.set(255, 255, 255)
- end
- bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
- if critical
- bitmap.font.size = 20
- bitmap.font.color.set(0, 0, 0)
- bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
- bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
- bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
- bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
- bitmap.font.color.set(255, 255, 255)
- bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
- end
- @_damage_sprite = ::Sprite.new(self.viewport)
- @_damage_sprite.bitmap = bitmap
- @_damage_sprite.ox = 80
- @_damage_sprite.oy = 20
- @_damage_sprite.x = self.x
- @_damage_sprite.y = self.y - self.oy / 2
- @_damage_sprite.z = 3000
- @_damage_duration = 40
- end
- end
复制代码 |
|