Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Character Face in Text Window

I'm using RPG Maker XP;

Just wondering if it's possible to use a face graphic bigger then 96x96???
I saw a YouTube video; someone made the face graphic larger, but it was also behind the text window.

I know that if you upload a face graphic bigger then this and try using it, it'll just show a portion of the graphic. (I tried. -_-')

Any help I can get with this would be greatly appreciated.

Thanks.

-A.M.B.
 

poccil

Sponsor

I assume you mean RPG Maker VX.

You would edit the draw_face method of Window_Base.  Put the following code before the last one in the script editor.

Code:
class Window_Base
  def draw_face(face_name, face_index, x, y, size = 96)
    bitmap = Cache.face(face_name)
    rect = Rect.new(0, 0, 0, 0)
    rect.x = face_index % 4 * (bitmap.width / 4)
    rect.y = face_index / 4 * (bitmap.height / 2)
    rect.width = size
    rect.height = size
    self.contents.blt(x, y, bitmap, rect)
    bitmap.dispose
  end
end
I hope this helps.
 
poccil":96gsrb6h said:
I assume you mean RPG Maker VX.

You would edit the draw_face method of Window_Base.  Put the following code before the last one in the script editor.

Code:
class Window_Base
  def draw_face(face_name, face_index, x, y, size = 96)
    bitmap = Cache.face(face_name)
    rect = Rect.new(0, 0, 0, 0)
    rect.x = face_index % 4 * (bitmap.width / 4)
    rect.y = face_index / 4 * (bitmap.height / 2)
    rect.width = size
    rect.height = size
    self.contents.blt(x, y, bitmap, rect)
    bitmap.dispose
  end
end
I hope this helps.


I'm using XP. Will this still work??
 
Will do. I'll let you guys know how it works.
Regi":28i5uoqy said:
AlexanderBlade, it sounds like you're already using a custom menu script since XP doesn't have the feature. Could you say which one?

Yeah bro, I'm using Dubealex's AMS.

Like I said earlier in the other thread, I have no idea what all to do to this script and the only thing I've been able to do is change font size and window skin.

The thing that confuses me about scripts is I'm not sure if I'm supposed to modify the actual script from the script page (where scripts are inserted) if I want something to happen, or if scripts just automatically activate.

But yeah, sorry, went on a tangent. xD

Dubealex's AMS is what I'm using.
 

poccil

Sponsor

Apparently the script does assume a size of 96x96, instead of an arbitrary size.  See lines 158-160 of the AMS:

Code:
    if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")
      self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
    end

Change it to the following:
Code:
    if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")
      faceBitmap=RPG::Cache.picture(@face_file)
      self.contents.blt(16, 16, faceBitmap, faceBitmap.rect)
    end

Also change lines 689-691:
Code:
    if @face_file != nil
      self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
    end

to the following:
Code:
    if @face_file != nil
      faceBitmap=RPG::Cache.picture(@face_file)
      self.contents.blt(16, 16, faceBitmap, faceBitmap.rect)
    end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top