Game Window Upscaling

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Crazy Li
Posts: 112
Joined: Fri Jan 03, 2014 3:35 pm

Game Window Upscaling

#1 Post by Crazy Li » Sun Feb 02, 2020 9:36 am

So I know that you can offer users the option to change the size of the game's window with something like textbutton _("Resolution") action Preference("display", #) where you put some value in for the number. This works great for anything below 1 to downscale the window, but doesn't seem to work the other way. With my game's default resolution being 720P, I tried to make the following options:

textbutton _("1280x720") action Preference("display", 1.0)
textbutton _("1600x900") action Preference("display", 1.25)
textbutton _("1920x1080") action Preference("display", 1.5)
textbutton _("Fullscreen") action Preference("display", "fullscreen")

but the game seems to cap out at 1 for this method. When attempting this, it just counted ALL windowed options as selected at once and you couldn't switch between since it thought they were all already selected. I saw an old post by Tom suggesting you could use something like 2.0 to double the window size, but that doesn't seem to the be the case? Unless I'm doing something wrong, but no matter what I try, it rejects any number higher than 1 and only works for decimals under 1. Does anyone know how I can accomplish what I'm trying to do? I'd like to give people with higher res monitors the option to play at a higher resolution if they find the window too small, but since I can't find BGs at a high enough resolution, I can't make the game default to anything larger than 720p (or else, I'd start higher and give the option to downscale instead). I know upscaling probably won't look pretty... but options are better than not having them IMO.

User avatar
Lemma-Class Veteran
Posts: 2472
Joined: Fri Dec 11, 2009 5:25 pm

Re: Game Window Upscaling

#2 Post by Alex » Sun Feb 02, 2020 10:02 am

The thing is that you can and do set the game resolution (relative mesures), not the actual (phisical) size of game screen.
You do it to make your graphical assets match the game screen. Like if you set the game screen size to (1024, 768) then your bg images that are (800,600) pxls would look smaller than game screen.

It doesn't matter what resolution players monitor/device have - Ren'Py will show the game screen that will fit the phisical screen and keep the aspect ratio of game screen that you've set (that's why you somethimes can seee black bars on the sides of game screen in fullscreen mode).

If you want to give the players option to choose resolution of game screen, you'll need to make sets of images in that resolutions to make them fit the game screen.

Considering that Ren'Py doing well with showing game screen on different devices this option might not be so useful.

The player can change the size of game window by dragging the corner of it (as usual). Also, you can set the phisical size of game screen on monitor/device by this function - ... sical_size

Post Reply

Who is online

Users browsing this forum: Google [Bot]