- Joined
- Jan 5, 2016
- Messages
- 149
- Reaction score
- 88
- First Language
- English
- Primarily Uses
- RMVXA
Hey y'all,
I need help editing a very cryptic method which draws an HP number using a custom sprite image instead of using the default text. Here is the method:
The problem is that no matter how I edit the image, the HP ends up looking like this:
Obviously it looks really awkward with the spacing of the numbers and this can't be fixed since in the sprite image, each number has a different width (for example, the number 1 has lots of room in its cell as opposed to 5 which requires a bigger cell). So I'm asking how to edit this code to reduce the space between numbers by 1 pixel. That should most definitely fix the problem, but this method is so foreign to me I have absolutely no idea how to go about making that fix. If anyone could help out and teach me how to edit this, that would be wonderful.
Thanks in advance!
I need help editing a very cryptic method which draws an HP number using a custom sprite image instead of using the default text. Here is the method:
Code:
def refresh_hp
@hp_number.bitmap.clear
number = @actor.hp.abs.to_s.split(//)
number_cw = @number_image_1_cw
number_ch = @number_image_1_ch
for i in 0..number.size - 1
number_abs = number[i].to_i
nsrc_rect = Rect.new(number_cw * number_abs, 0, number_cw , number_ch)
@hp_number.bitmap.blt(number_cw * i, 0, @number_image_1, nsrc_rect)
end
end
Thanks in advance!
