So, I have an issue with Moghunter's Battle HUD script and with Victor's SFonts.
I needed to make the character's name uses the SFont too.
I found this thread that managed to solve the solution.
https://forums.rpgmakerweb.com/index.php?threads/victor-sfonts-as-default-font.81420/
However, I'm unsure of what are the arguments used for Victor's SFont script.
This is the method to draw the text using SFont, I assume.
This is Moghunter's original method to draw the name.
And lastly, my failed method so far to draw the name text using SFonts.
This is the error that occurs when I started the battle test.

Line 201 gives me this:
Would anyone give me a pointer on what I did wrong?
I needed to make the character's name uses the SFont too.
I found this thread that managed to solve the solution.
https://forums.rpgmakerweb.com/index.php?threads/victor-sfonts-as-default-font.81420/
However, I'm unsure of what are the arguments used for Victor's SFont script.
This is the method to draw the text using SFont, I assume.
Code:
def draw_sfont_text(*args)
is_rect = args[0].is_a?(Rect)
x = is_rect ? args[0].x : args[0]
y = is_rect ? args[0].y : args[1]
width = is_rect ? args[0].width : args[2]
height = is_rect ? args[0].height : args[3]
text = is_rect ? args[1].to_s : args[4].to_s
align = is_rect ? args[2] : args[5]
bitmap = sfont.draw_text(text)
x += width - bitmap.width if align == 2
x += (width - bitmap.width) / 2 if align == 1
y += (height - bitmap.height) / 2 - 4
blt(x, y, bitmap, bitmap.rect)
end
Code:
@name.bitmap.draw_text(0,0,160,32,@actor.name,NAME_ALIGN_TYPE)
Code:
@name.bitmap.draw_sfont_text(0,0,160,32,@actor_name,0)

Line 201 gives me this:
Code:
bitmap = sfont.draw_text(text)



