A few things here:
About the game resolution
- Your game resolution is defined by your gui.init() line in the gui.rpy file by default. Once that's set, that's the resolution of your game.
- When your player resizes their game window, Renpy itself doesn't change resolution as such, it lets the OpenGL engine scale everything accordingly. Some people mistaken that if the player's screen resolution is a certain size, and they fullscreen the game, the game itself changes resolution automatically - that's not the case at all, OpenGL will handle the scaling automatically, so the game's internal resolution stays the same.
- Therefore if your game allows your player to change resolutions - you'd have to code it with variables to begin with. Therefore you can grab the width and height from said variables.
Next we have the issue of what you're trying to achieve - assuming you've got some preferences allowing your players to change your game's resolution, you want to use the correct image size for each resolution. Don't condition checks to display the images! Your game will likely have hundreds if not thousands of instances calling for images - having to write a condition each time is just not an efficient method. Plus, if you're storing 2 versions of your images, one for 1080p and one for 720p, you're unnecessarily bloating up your game's file size.
Instead, just keep the 1080p image files, and use another variable for "zooming" your images. 720p is 66.67% the width and height of the 1080p, so set your zoom variable to 0.67 and have all your images a zoom:
Code: Select all
define img_zoom = 0.67
image image1:
"image1.png"
zoom img_zoom
Change the img_zoom to 1 if the game's at 1080p obviously. Then your images should scale accordingly. Alternatively, if you're using pixel art style, you may consider scaling up the 720p raw images to 1.5 - see what works best for you.