7

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?

Neuron
  • 5,141
  • 5
  • 38
  • 59
Ashwin Nanjappa
  • 76,204
  • 83
  • 211
  • 292

1 Answers1

9

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.

Neuron
  • 5,141
  • 5
  • 38
  • 59
Juan Sosa
  • 5,262
  • 1
  • 35
  • 41