加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
前面显示HP伤害数值,后面显示SP伤害数值。
本来想显示两条的,可是弄不起来。
数值能正确显示,可是中间加了“SP”却是显示“0”
空格也没显示出来
if value.is_a?(Numeric) bitmap_number_image = RPG::Cache.windowskin("Damage_Number") bitmap = Bitmap.new(bitmap_number_image.width,bitmap_number_image.height) bitmap_im_cw = bitmap_number_image.width / 10 bitmap_im_ch = bitmap_number_image.height / 3 bitmap_number_text = value.to_s.split(//) spsz = value_sp.to_s.split(//) bitmap_number_text.push(" SP ") bitmap_number_text = bitmap_number_text + spsz p bitmap_number_text # if value >= 0 for r in 0..bitmap_number_text.size - 1 bitmap_number_abs = bitmap_number_text[r].to_i if critical == false bitmap_src_rect = Rect.new(bitmap_im_cw * bitmap_number_abs,0 , bitmap_im_cw, bitmap_im_ch) else bitmap_src_rect = Rect.new(bitmap_im_cw * bitmap_number_abs, bitmap_im_ch * 2, bitmap_im_cw, bitmap_im_ch) end bitmap.blt(60 + ((bitmap_im_cw - 7) * r), 0, bitmap_number_image, bitmap_src_rect) end
if value.is_a?(Numeric)
bitmap_number_image = RPG::Cache.windowskin("Damage_Number")
bitmap = Bitmap.new(bitmap_number_image.width,bitmap_number_image.height)
bitmap_im_cw = bitmap_number_image.width / 10
bitmap_im_ch = bitmap_number_image.height / 3
bitmap_number_text = value.to_s.split(//)
spsz = value_sp.to_s.split(//)
bitmap_number_text.push(" SP ")
bitmap_number_text = bitmap_number_text + spsz
p bitmap_number_text
# if value >= 0
for r in 0..bitmap_number_text.size - 1
bitmap_number_abs = bitmap_number_text[r].to_i
if critical == false
bitmap_src_rect = Rect.new(bitmap_im_cw * bitmap_number_abs,0 , bitmap_im_cw, bitmap_im_ch)
else
bitmap_src_rect = Rect.new(bitmap_im_cw * bitmap_number_abs, bitmap_im_ch * 2, bitmap_im_cw, bitmap_im_ch)
end
bitmap.blt(60 + ((bitmap_im_cw - 7) * r), 0, bitmap_number_image, bitmap_src_rect)
end
|