Centering images by default

Is there a way to center an image on the screen regardless of the resolution? I know CSS has a way to do this on computer screens, but I'm not sure if RPG Maker can do this. Ideally, I'd like to not have to change the image rendering parameters if I need to make versions with different screen sizes.
You can show the picture based on variables, so you can easily do the math with

Graphics.boxWidth and Graphics.boxHeight I would think.
Origin: Center with X = 0 and Y = 0 does that already.


1780615762276.png


Edit: this is wrong
Origin: Center with X = 0 and Y = 0 does that already.

View attachment 367534
This is not quite correct.
The origin is the anchor the image uses, not the screen. So with a center at 0, 0, you are putting the middle of the image at the top left corner of the screen.
You can show the picture based on variables, so you can easily do the math with

Graphics.boxWidth and Graphics.boxHeight I would think.
Can you please provide an example? Where does this belong? Thanks.
Can you please provide an example? Where does this belong? Thanks.
1780620195825.png

1780620208258.png

1780620224192.png

1780620240125.png


Spoiler
The result in 1280x720:
1780620612666.png

800x600:
1780620627816.png

and in 4k:
1780620642300.png
Amazing, thanks! Your project and maps look really well-made, too.
Amazing, thanks! Your project and maps look really well-made, too.
You're welcome and thanks!

Original thread: https://forums.rpgmakerweb.com/threads/centering-images-by-default.183916/