Ashwin Nanjappa
Ashwin Nanjappa

Reputation: 78538

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?

Upvotes: 7

Views: 2927

Answers (1)

Juan Sosa
Juan Sosa

Reputation: 5280

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.

Upvotes: 9

Related Questions