Had some trouble where on my custom game over screen, "Game Over" text image wasn't centered (I used "Show Picture"). Anyone know how to resolve this issue?
RMMZ - Image Centering (Solved!)
RPG Maker MZ SupportI would think the easiest way would be to make the image the same size as the screen resolution then center everything on the image, rather than trying to position in the editor.
of you use show picture, centering should be as easy as using the center option with the center of the screen as coordinates.
you need to show us your show picture command to see what you did wrong.
you need to show us your show picture command to see what you did wrong.
Here's my command line
I tried that, but for some reason it still aligns left, and when I enter coords on Center Origin, it pushes the image off screen. I feel like I'm missing something very obvious. Below is a screen capture from GIMP of how it should look...
If the image size and screen size are the same, you should just need to use upper-left to anchor the picture at 0,0 and 100% size (the screenshot of your event looks just right); that should put your picture's upper-left corner at the upper left of the screen and fill every pixel on the screen evenly (I mean, aside from most of them being transparent pixels). Just judging by the first screenshot, it looks like the screen is wider than the image, so when the image is anchored left there's a gap on the opposite side.
Honestly, if you've got all that right...I don't know what else the problem could be. You could try using center positioning for the picture and put the x,y coords as the center pixel of your map like Andar said, but that should net the same results if the above is all correct. Hope that helps!
Honestly, if you've got all that right...I don't know what else the problem could be. You could try using center positioning for the picture and put the x,y coords as the center pixel of your map like Andar said, but that should net the same results if the above is all correct. Hope that helps!
yes you do.
when using upper left anchor, then all pictures need to focus on the upper left 0,0 coordinates, and they align there - which is good if those pictures are all exactly screen size.
however when using center coordinates, you need to focus on the center point of your screen, which is half max height and half max wide.
by default that is 408,312 (half of default screen 816x624)
use those as the targeting data with center alignment and it will automatically work no matter how large or small your pictures are.
you using 0,0 with center alignment meant that the center of the picture was aligned to the left upper coordinate, pushing most of it off-screen.
so calculate the center of your screen size and use that with center aligned origin and all should work.
if you still have problems after this, please give us the numbers of your screen size, the numbers of your picture size and a screenshot of the show picture window with the settings you have.
Thanks for your help! I got the situation ironed out thanks to your equation. I don't know why I didn't know this before, but it'll help me improve the quality of future games as well!
Thanks to Andar, I got the situation handled, but MAN!, I don't know how I didn't think of trying this before.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/rmmz-image-centering-solved.145716/