Page MenuHome

Change window size/resolution in realtime
Closed, ArchivedPublicPATCH

Description

This patch allows the user to change the size of the window (or the resolution in fullscreen mode) using the new bge.render.resize() method. This only works in the Blenderplayer since it doesn't make a whole lot of sense for the embedded player. Also, I'm uncertain on the name "resize" for the method. The supplied blendfile makes use of the new method when you press the spacebar, but you'll have to save it to a runtime first (or load it via blenderplayer resize.blend). You might want to change the size in the script before running depending on your screen resolution.

Event Timeline

Uploading a new patch based on r42983. (No functional changes to the patch)

This patch works well for me. +1

I suggest either "setMode" or "setResolution" for the name in the API. Quake 2 uses SetMode internally, but it is a little cryptic.

Would it be possible to add a fullscreen=True argument? I'm not sure if changing between windowed and fullscreen modes is supported by GHOST, though. Maybe this should be done later.

Mitchell Stokes (moguri) changed the task status from Unknown Status to Unknown Status.Jan 22 2012, 9:29 PM