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.

[Resolved] [VX] Displaying a character's portrait in status menu

ikos

Member

Hey-a all,

So, I've been writing my own status script, and it's been going well. I was wondering how would I picture of the character (say, kept in the Pictures folder or something). I only really need the general code line (I don't think "draw_actor_portrait" will work ¬¬).

Hope that made a lick of sense.  :huh:

~Ikos out :thumb:
 
Code:
class Window_Base < Window
  def draw_actor_picture(picture_name, x, y)
    bitmap = Cache.picture(picture_name)
    rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(x, y, bitmap, rect)
    bitmap.dispose
  end
end
That small modification to Window_Base should do it. It seems that you have some experience so you should know how to use and modifiy it to your tastes.

Later
 

ikos

Member

IvIagnuIvI":aoolidv5 said:
Code:
class Window_Base < Window
  def draw_actor_picture(picture_name, x, y)
    bitmap = Cache.picture(picture_name)
    rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(x, y, bitmap, rect)
    bitmap.dispose
  end
end
That small modification to Window_Base should do it. It seems that you have some experience so you should know how to use and modifiy it to your tastes.

Later

Actually, it doesn't seem to be working.
I have a file called "ikos.png" in Grapics/Pictures.
I feel really stupid right now. >_o
 
Try this:
Code:
class Window_Base < Window
  def draw_actor_picture(picture_name, x, y)
    bitmap = Cache.picture(picture_name)
    self.contents.blt(x, y, bitmap, bitmap.rect)
  end
end

Now, in Window_Status or whatever it is, you will need to add a line
Code:
draw_actor_picture(@actor.name, x, y)

Just adjust your x & y.
 

ikos

Member

SephirothSpawn":21xbsvq9 said:
Try this:
Code:
class Window_Base < Window
  def draw_actor_picture(picture_name, x, y)
    bitmap = Cache.picture(picture_name)
    self.contents.blt(x, y, bitmap, bitmap.rect)
  end
end

Now, in Window_Status or whatever it is, you will need to add a line
Code:
draw_actor_picture(@actor.name, x, y)

Just adjust your x & y.

Seph, I am buying you a drink. Where the hell do you live? >>
 

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