Disable automatic window resizing

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
Message
Author
User avatar
Tayruu
Regular
Posts: 141
Joined: Sat Jul 05, 2014 7:57 pm

Disable automatic window resizing

#1 Post by Tayruu »

It seems that Ren'py has a function to decrease the game size if it's too close to the OS's current resolution.

As an example, I currently have my resolution set to 1368x912. My Ren'py project is supposed to be 1280x720 - that ought to fit on screen, but Ren'py decreases it ever so slightly, down to 1265x712, and I don't see any way to force it to be 1280x720. The game remains its native resolution if the OS (W10) resolution is 1600x900 or more.

Using config.adjust_view_size seems to give a native-looking resolution, but throws a subsurface rectangle outside surface area error during transitions, perhaps because of trying to render at the full resolution while the screen has been resized. Starting in full-screen avoids the error, even when returning to windowed mode.

I'm looking for a way to prevent this resizing, so the game renders natively since it ought to be able to. (Honestly this is all because I've set my OS resolution itself to something not-native, because 2736x1824 is just silly.)
Last edited by Tayruu on Fri Jun 01, 2018 10:19 am, edited 1 time in total.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Disable automatic window resizing

#2 Post by Imperf3kt »

Are you running windowed? You must account for the titlebar and border edges of the window itself.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Tayruu
Regular
Posts: 141
Joined: Sat Jul 05, 2014 7:57 pm

Re: Disable automatic window resizing

#3 Post by Tayruu »

I'm not sure how that's relevant?

To clarify, I don't intend to use adjust_view_size or similar in the game proper, the reason I made use of that function was to try and make sure the windowed size was what I expected. What I want to know is why Ren'py seems to shrink the game window ever so slightly because of my resolution.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Disable automatic window resizing

#4 Post by Imperf3kt »

I recall reading something in the documentation about calculating window size, stating that title bars and windows frames were included in that figure. Though, I cannot find it, so I may have misread it or may be remembering it incorrectly or may even be looking in the wrong place.

You can see this yourself, maximise a 1920x1080 game on a 1920x1080 monitor but keep it windowed. The screenshot will actually be 18xx pixels by 9xx pixels (I use x's because I forget the exact sizes)
The lost pixels account for the sides, bottom and top of the "window" that makes up the Ren'Py game. If you were to display it fullscreen, these pixels wou;dn't be lost because there's no need to display a titlebar or borders, on a fullscreen application, hence all the screen space is available for the game, rather than the OS UI.
Thats how I thought it was relevant.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Tayruu
Regular
Posts: 141
Joined: Sat Jul 05, 2014 7:57 pm

Re: Disable automatic window resizing

#5 Post by Tayruu »

I get the feeling what's resizing the game window is buried within files I cannot access. Specifically encrypted .pyd files in Renpy's lib directory.

I suspected that draw.set_mode in display/core.py is what returns a downscaled window, but the set_mode that gets called in the first place is out of my reach. (The software render files might be open, but that renderer lags like heck. The OpenGL render files are definitely encrypted.)

... but I don't want to modify those files. I just wanted to find what Renpy was doing so I could counteract it. Because I want to edit my game in native pixels so I know I'm doing things correctly. But instead Renpy's shrinking it. My only choice at the moment seems to be full-screen and adjust_view_size.

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Disable automatic window resizing

#6 Post by kivik »

Do you have a screenshot to show your problem? I actually suspect the reason has nothing to do with Renpy but the OS, and the dimensions you described does seem to imply there should be enough space (192 pixels in height and 88 pixels in width spare) so it does seem weird that it does that.

However, I think you're spending a lot of time stressing over something that ultimately really doesn't matter to your players. 1368x912 is not exactly a common resolution, and even if it is - rest assure your player will either resize it down so that they can have something in the background (youtube in my case) or fullscreen it if they're really engrossed. And since OpenGL renders your game according to the player's windows size, it'd mean your attempt to get pixel precision on the player's screen is moot - you just can't control it (please don't disable window resizing, that's very anti-player design).

I get the obsession with details, but sometimes it's ok to let go :)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]