dynamic screen 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
pucedragonlord
Regular
Posts: 159
Joined: Wed May 09, 2012 2:49 am
Projects: The Diviner
Organization: Two Crowns Entertainment
Location: Now: Charlottesville, VA
Contact:

dynamic screen resizing

#1 Post by pucedragonlord » Mon Jan 20, 2014 11:35 pm

So knowing that the window dimensions are set during init and the fullscreen setting is only run the first time you run a game, is it possible to set up a system to allow players to turn on and off fullscreen during gameplay?

Related: Is there a way to dynamically change the game's dimensions based on the size of the gl draw window with config.gl_resize set to true? I understand there are of course all manner of complications that could ensue from this, but can it be done within RenPy?
The more you know

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: dynamic screen resizing

#2 Post by PyTom » Tue Jan 21, 2014 12:03 am

Both cases already exist.

You can toggle fullscreen mode from the preferences window, and you can drag to resize the window.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
pucedragonlord
Regular
Posts: 159
Joined: Wed May 09, 2012 2:49 am
Projects: The Diviner
Organization: Two Crowns Entertainment
Location: Now: Charlottesville, VA
Contact:

Re: dynamic screen resizing

#3 Post by pucedragonlord » Tue Jan 21, 2014 12:29 am

I must not have messed with the preference menu much last time I worked with RenPy. That makes things easier.

I should probably qualify a little better on the resizing thing. It's not resizing the window I'm unsure how to do, it's having the game itself resize when the player expands the window. As it seems to work now, if I drag the window out, the game screen remains the same resolution leaving black bars around whichever dimension has been dragged out beyond the default setting defined in the options file. I want to know if there's a way to have that setting grow with the window size.

Does that make sense, or am I spouting nonsense?
The more you know

User avatar
Donmai
Eileen-Class Veteran
Posts: 1919
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: dynamic screen resizing

#4 Post by Donmai » Tue Jan 21, 2014 9:44 am

To turn fullscreen on/off during gameplay you just need to tap the 'f' key.
Maybe you will want to add multiple resolution options to your game?
http://lemmasoft.renai.us/forums/viewto ... 94#p294594
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

Crazy Li
Regular
Posts: 113
Joined: Fri Jan 03, 2014 3:35 pm
Contact:

Re: dynamic screen resizing

#5 Post by Crazy Li » Tue Jan 21, 2014 9:21 pm

pucedragonlord wrote:I must not have messed with the preference menu much last time I worked with RenPy. That makes things easier.

I should probably qualify a little better on the resizing thing. It's not resizing the window I'm unsure how to do, it's having the game itself resize when the player expands the window. As it seems to work now, if I drag the window out, the game screen remains the same resolution leaving black bars around whichever dimension has been dragged out beyond the default setting defined in the options file. I want to know if there's a way to have that setting grow with the window size.

Does that make sense, or am I spouting nonsense?
I once heard that when using software rendering, the game will stretch to fit the window no matter how it's resized. Though I can't say how one would force software rendering, and Tom tends to strongly advise against software rendering, favoring OpenGL.

I once saw someone made a script that would automatically find the resolution that the user's computer is using and scale everything to that. It didn't work for me, though. When I tried it, I got an error that the functions being called didn't exist. I'm assuming he had additional plugins or assets that he didn't mention in his tutorial.

I do think it would be neat to be able to allow a user to switch between a 16:9 and 4:3 aspect ratio depending on their needs, but I doubt Ren'py has an elegant way to accomplish this. I've noticed that on older professional VNs that use 4:3 aspect, fullscreen tends to go 16:9 stretch on a widescreen monitor anyway, but Ren'py will do the black bars and maintain the aspect ratio (which from a technical standpoint is usually preferable, so I imagine this is by design). I never want my windowed resolution to be the same as my full screen resolution because that defeats the purpose of a window.

User avatar
pucedragonlord
Regular
Posts: 159
Joined: Wed May 09, 2012 2:49 am
Projects: The Diviner
Organization: Two Crowns Entertainment
Location: Now: Charlottesville, VA
Contact:

Re: dynamic screen resizing [solved]

#6 Post by pucedragonlord » Thu Jan 23, 2014 9:32 pm

I agree that it's better to maintain an aspect ratio than not have black bars, I just wanted to know if there was some way to get as close to the players' native resolutions as possible. That multiple aspect ratio option will work great. Thanks for the help!
The more you know

Post Reply

Who is online

Users browsing this forum: Google [Bot]