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.

Picture Overlap...(new question)

I am wondering how to make the gold value in the menu stay centered. So, instead of the value just increasing the numbers to the left, it also pushes the G at the end, right. Anyone know how to do this easily?? Thanks


Edit: Also, I have another question, not directly related to this.... How would you overide window_selectable in Scene_Main so that when you press left, it moves the cursor "up", but it shows it moving left. I have a menu, where there are pictures for the options, and they go horizontal. It's set up so that there is a cursor that moves to each option with a set X,Y coord. I want it to be so that you can press left and right, instead of up and down, to change options. But I only want it in Scene_Main, no where else. What little section of code would I need for that? Thanks again....

New Question farther down...

~xgamexfreakx
 
I don't really understand. Explain...

It does make the two pictures though. When I tried what you suggested earlier, it showed both pics, but they were both crammed into the box so I know it's there, its just underneath. I'm guessing that because the default status menu sets up the pics downwards, its moving the pics down like it normaly would. That is where I think the problem is, but I don't know how to even go about trying to fix it...
 
It doesn't have to be underneath. In fact, that makes no sense at all. The y value stays the same.
You see, only the x value is dynamic. Unless your face-block proves to output the bitmap in a completely odd position, these values are correct all the way.

Let me explain, if you have 2 actors, it will return these values:

First Actor: x = i * 167 + 20 = 0
Second Actor: x = x = i * 167 + 20 = 187

And so it continues if you have more. I have experienced problems with the 'blt' method when it comes to positioning before, this might be the cause of the fact that the picture is big. I don't know the source code for the 'blt' method, but apparently it has some weird positioning syntax.

The 'blt' function is part of the Bitmap class, of which there are no source for as I can see. You might wanna experiment with the x values of your face block (not the Window_MenuStatus, but the draw_face one).
 
Well, I tried playing with them. I reset them back to default, and set them opposite. I adjusted the size of the box to go all the way across the screen and I tried reverting to the small face pictures. I still only got one pic. It somewhere in the changes that I made obviously, but I'm not sure just which one. I may have to start all over in my changes and see where the error is...
 
shouldn't the src_rect x and y always be 0? provided each face graphic is saved in a separate file? From what I can recall the src_rect is a rectangle drawn in the file you're transferring from. so if your x and y are more than 0, it'll only show part of the picture, or none at all if those values are outside the picture.
 
Beran":146bso49 said:
shouldn't the src_rect x and y always be 0? provided each face graphic is saved in a separate file? From what I can recall the src_rect is a rectangle drawn in the file you're transferring from. so if your x and y are more than 0, it'll only show part of the picture, or none at all if those values are outside the picture.
That is it. The Rect.new should be:
Code:
Rect.new(0, 0, face.width, face.height)
If not, as Beran stated, the face is going to be misplaced or cut out. So basically, replace your draw_face method with this:
Code:
  def draw_face(actor,x,y)
    face = RPG::Cache.picture(actor.name + "_fc2") rescue nada
    face_width = face.width
    face_height = face.height
    src_rect = Rect.new(0, 0, face_width, face_height)
    self.contents.blt(x - 50, y - 20, face, src_rect)
  end

Hope this works.
 

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