'How to change the window size in Panda3D?

A Panda3D program opens with a certain window size. I cannot find any call in GraphicsWindow to set or change the window size.

How do I change the window size?



Solution 1:[1]

You can change the initial window size in your Config.prc file, OR you can prepend the following code in your main python file:

from panda3d.core import loadPrcFileData 
  
loadPrcFileData('', 'win-size 1024 768') 

If you want to change the window size at runtime the following code should do the trick:

w, h = 1024, 768 

props = WindowProperties() 
props.setSize(w, h) 

self.win.requestProperties(props) 

Hope it helps.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Neuron - Freedom for Ukraine