RPG Maker Forums

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.
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
This is Moghunter's original method to draw the name.
Code:
@name.bitmap.draw_text(0,0,160,32,@actor.name,NAME_ALIGN_TYPE)
And lastly, my failed method so far to draw the name text using SFonts.
Code:
@name.bitmap.draw_sfont_text(0,0,160,32,@actor_name,0)
This is the error that occurs when I started the battle test.
upload_2019-3-11_1-30-44.png

Line 201 gives me this:
Code:
bitmap = sfont.draw_text(text)
Would anyone give me a pointer on what I did wrong?

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,454
Members
137,821
Latest member
Capterson
Top