Turn off game auto-scaling

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
Chieftac
Newbie
Posts: 18
Joined: Thu Sep 26, 2013 5:52 pm
Contact:

Turn off game auto-scaling

#1 Post by Chieftac »

I wonder if it is possible to turn off auto-scaling in Ren'Py. I want to use some pixel-art in my game but it looks really ugly when it is scaled in combination with anti-aliasing. I want my game to always be the same resolution (no scaling to other resolutions). So when you go fullscreen the rest of the screen outside of the game window goes black and the game window itself is centered in the middle of screen. I know that this feature is possible in other game engines, but I wasn't sure if Ren'Py also has this feature.

User avatar
PREZ
Newbie
Posts: 6
Joined: Wed Mar 14, 2018 3:45 pm
Location: Cantabria, Spain
Contact:

Re: Turn off game auto-scaling

#2 Post by PREZ »

I've found this definitions, but I haven't tested them.

define config.adjust_view_size = None link
If not None, this should be a function taking two arguments, the width and height of the physical window. It is expected to return a tuple giving the width and height of the OpenGL viewport, the portion of the screen that Ren'Py will draw pictures to.

This can be used to configure Ren'Py to only allow certain sizes of screen. For example, the following allows only integer multiples of the original screen size:

Code: Select all

init python:

    def force_integer_multiplier(width, height):
        multiplier = min(width / config.screen_width, height / config.screen_height)
        multiplier = max(int(multiplier), 1)
        return (multiplier * config.screen_width, multiplier * config.screen_height)

    config.adjust_view_size = force_integer_multiplier
define config.gl_enable = True link
Set this to False to disable OpenGL acceleration. OpenGL acceleration will automatically be disabled if it's determined that the system cannot support it, so it usually isn't necessary to set this.

OpenGL can also be disabled by holding down shift at startup.

define config.gl_resize = True
Determines if the user is allowed to resize an OpenGL-drawn window.

define config.screen_height = 600 link
The height of the screen. Usually set by gui.init().

define config.screen_width = 800
The width of the screen. Usually set by gui.init().

Chieftac
Newbie
Posts: 18
Joined: Thu Sep 26, 2013 5:52 pm
Contact:

Re: Turn off game auto-scaling

#3 Post by Chieftac »

This isn't really the right solution.

"define config.adjust_view_size = None" and "define config.gl_enable = False", both basicly only disable the fullscreen button.

But I still want to go to fullscreen and that the rest of my computer screen outside of the game goes black (with the game centered in the middle of the screen).

Basicly the aspect ratio of the game shouldn't change when I go to fullscreen.

Post Reply

Who is online

Users browsing this forum: Google [Bot]