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.

How can I do this?

Firstly, sorry as I probably seem like I post here too much...

Anyway, I am trying to make it so that the face graphic with the name of variable[1] is shown in my Hud.

I was looking at Dube's ABS and saw he did face graphics like this:

Code:
@face_file = $1 + ".png"
       self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))

So I thought maybe something like this would work:

Code:
    @facegfx = $game_variables[1] + ".png"
    @face_sprite.bitmap = RPG::Cache.picture(@facegfx)
    @face_sprite.x = 514 # Change the x value here
    @face_sprite.y = 17 # Change the y value here
    @face_sprite.z = 250 # Change the z value here

Turns out it didn't; how can I do this?
 
first, do you want to show the face using a sprite or do you want to display it in a window?

edit : if you want to draw in a window, you should do it like this :
Code:
# usually in the refresh method
bmp = RPG::Cache.whatever($game_variables[1])
self.contents.blt(x, y, bmp, Rect.new(0, 0, bmp.width, bmp.height))

if you want to draw display it using a sprite, it goes like this :
Code:
@sprite = Sprite.new
@sprite.xyz = whatever
@sprite.bitmap = RPG::Cache.whatever($game_variables[1])
I think you know but you've got to create the sprite inside the Scene_Map class. Same for the window in which you draw the face.
 

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