赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 25 |
经验 | 1565 |
最后登录 | 2024-10-31 |
在线时间 | 437 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 2500
- 在线时间
- 437 小时
- 注册时间
- 2016-10-1
- 帖子
- 42
|
4楼
楼主 |
发表于 2016-10-2 11:43:48
|
只看该作者
谢谢各位解答,但是我想了很久却不知道该如何添加,我的伤害字体图片是如下图,RTAB伤害美化的脚本,怕乱改会出错...
# ダメージ表示改造(RTAB用) ver 1.02 # 配布元・サポートURL # [url]http://members.jcom.home.ne.jp/cogwheel/[/url] class Scene_Battle alias :atb_setup_original :atb_setup def atb_setup for path in ["num", "critical", "miss", "levelup", "newskill", "learning"] RPG::Cache.numeric(path) end atb_setup_original end end module RPG class Sprite < ::Sprite WIDTH = 18 # 文字幅 HEIGHT = 20 # クリティカルの文字・高さ def damage(value, critical, type = 0) if value.is_a?(Numeric) damage_string = value.abs.to_s else damage_string = value.to_s end if value.is_a?(Numeric) and value >= 0 if type == 0 if critical d_bitmap = draw_damage(value, 1) else d_bitmap = draw_damage(value, 0) end else d_bitmap = draw_damage(value, 2) end else if type == 0 d_bitmap = draw_damage(value, 3) else d_bitmap = draw_damage(value, 4) end end if type == 2 d_bitmap = draw_damage(value, 5) end num = @_damage.size if type != 2 @_damage.push([::Sprite.new, 40, 0, rand(40) - 20, rand(30) + 50]) else @_damage.push([::Sprite.new, 40, 0, rand(20) - 10, rand(20) + 60]) end @_damage[num][0].bitmap = d_bitmap @_damage[num][0].ox = d_bitmap.width / 2 @_damage[num][0].oy = d_bitmap.height / 2 if self.battler.is_a?(Game_Actor) @_damage[num][0].x = self.x + self.viewport.ox @_damage[num][0].y = self.y - self.oy / 2 else @_damage[num][0].x = self.x + self.viewport.rect.x - self.ox + self.src_rect.width / 2 @_damage[num][0].y = self.y - self.oy * self.zoom_y / 2 + self.viewport.rect.y @_damage[num][0].zoom_x = self.zoom_x @_damage[num][0].zoom_y = self.zoom_y @_damage[num][0].z = 3000 end end def draw_damage(value, element) width = 0 if value.is_a?(Numeric) value = value.abs fig = value.to_s.size - 1 file = RPG::Cache.numeric("num") d_width = WIDTH * fig + file.rect.width / 10 if element == 1 critical = RPG::Cache.numeric("critical") d_width = [d_width, critical.rect.width].max d_bitmap = Bitmap.new(d_width+36, HEIGHT + file.rect.height / 5) d_x = 0#(width - critical.rect.width / 10) / 2 d_bitmap.blt(d_x+fig*(fig/1.6), 0, critical, critical.rect) # 会心一击表现效果强化 Audio.se_play("Audio/SE/"+"Clip10",100,100) $game_screen.start_flash(Color.new(255,255,255),10) $game_screen.start_shake(3,9,10) else d_bitmap = Bitmap.new(d_width, HEIGHT + file.rect.height / 5) end d_x = ((d_width) - (WIDTH * fig + file.rect.width / 10)) / 2 while fig >= 0 d_bitmap.blt(d_x, HEIGHT, file, Rect.new((value / (10 ** fig)) * file.rect.width / 10, element * file.rect.height / 5, file.rect.width / 10, file.rect.height / 5)) d_x += WIDTH value %= 10 ** fig fig -= 1 end else case value when "Miss" file = RPG::Cache.numeric("miss") when "Level up!" file = RPG::Cache.numeric("levelup") when "New Skill!" file = RPG::Cache.numeric("newskill") when "Learning!" file = RPG::Cache.numeric("learning") else return Bitmap.new(1, 1) end d_bitmap = file end return d_bitmap end end module Cache def self.numeric(filename) self.load_bitmap("Graphics/String/", filename) end end end
# ダメージ表示改造(RTAB用) ver 1.02
# 配布元・サポートURL
# [url]http://members.jcom.home.ne.jp/cogwheel/[/url]
class Scene_Battle
alias :atb_setup_original :atb_setup
def atb_setup
for path in ["num", "critical", "miss", "levelup", "newskill", "learning"]
RPG::Cache.numeric(path)
end
atb_setup_original
end
end
module RPG
class Sprite < ::Sprite
WIDTH = 18 # 文字幅
HEIGHT = 20 # クリティカルの文字・高さ
def damage(value, critical, type = 0)
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
end
if value.is_a?(Numeric) and value >= 0
if type == 0
if critical
d_bitmap = draw_damage(value, 1)
else
d_bitmap = draw_damage(value, 0)
end
else
d_bitmap = draw_damage(value, 2)
end
else
if type == 0
d_bitmap = draw_damage(value, 3)
else
d_bitmap = draw_damage(value, 4)
end
end
if type == 2
d_bitmap = draw_damage(value, 5)
end
num = @_damage.size
if type != 2
@_damage.push([::Sprite.new, 40, 0, rand(40) - 20, rand(30) + 50])
else
@_damage.push([::Sprite.new, 40, 0, rand(20) - 10, rand(20) + 60])
end
@_damage[num][0].bitmap = d_bitmap
@_damage[num][0].ox = d_bitmap.width / 2
@_damage[num][0].oy = d_bitmap.height / 2
if self.battler.is_a?(Game_Actor)
@_damage[num][0].x = self.x + self.viewport.ox
@_damage[num][0].y = self.y - self.oy / 2
else
@_damage[num][0].x = self.x + self.viewport.rect.x -
self.ox + self.src_rect.width / 2
@_damage[num][0].y = self.y - self.oy * self.zoom_y / 2 +
self.viewport.rect.y
@_damage[num][0].zoom_x = self.zoom_x
@_damage[num][0].zoom_y = self.zoom_y
@_damage[num][0].z = 3000
end
end
def draw_damage(value, element)
width = 0
if value.is_a?(Numeric)
value = value.abs
fig = value.to_s.size - 1
file = RPG::Cache.numeric("num")
d_width = WIDTH * fig + file.rect.width / 10
if element == 1
critical = RPG::Cache.numeric("critical")
d_width = [d_width, critical.rect.width].max
d_bitmap = Bitmap.new(d_width+36, HEIGHT + file.rect.height / 5)
d_x = 0#(width - critical.rect.width / 10) / 2
d_bitmap.blt(d_x+fig*(fig/1.6), 0, critical, critical.rect)
# 会心一击表现效果强化
Audio.se_play("Audio/SE/"+"Clip10",100,100)
$game_screen.start_flash(Color.new(255,255,255),10)
$game_screen.start_shake(3,9,10)
else
d_bitmap = Bitmap.new(d_width, HEIGHT + file.rect.height / 5)
end
d_x = ((d_width) - (WIDTH * fig + file.rect.width / 10)) / 2
while fig >= 0
d_bitmap.blt(d_x, HEIGHT, file, Rect.new((value / (10 ** fig)) *
file.rect.width / 10, element * file.rect.height / 5,
file.rect.width / 10, file.rect.height / 5))
d_x += WIDTH
value %= 10 ** fig
fig -= 1
end
else
case value
when "Miss"
file = RPG::Cache.numeric("miss")
when "Level up!"
file = RPG::Cache.numeric("levelup")
when "New Skill!"
file = RPG::Cache.numeric("newskill")
when "Learning!"
file = RPG::Cache.numeric("learning")
else
return Bitmap.new(1, 1)
end
d_bitmap = file
end
return d_bitmap
end
end
module Cache
def self.numeric(filename)
self.load_bitmap("Graphics/String/", filename)
end
end
end
|
-
num.png
(30.82 KB, 下载次数: 8)
希望是在最下面那個藍色字體
|