Changing screen resolution

Is it possible to change the screen res when the game is running?

Take a look at the ‘Runtime fullscreen toggle’ thread:
It most likely will also work for changing resolutions with a little modifying.

Changing the size of a window without going fullscreen is much easier than switching between fullscreen and windowed. You can just do:

wp = WindowProperties()
wp.setSize(width, height)


Well,what i basically want to do is to allow people to set the screen res for their monitor.Say,i make the game for 1024x768 but if they have higher res monitors the can play in fullscreen and the images will be zoomed.
Im not shure if Panda does all this automatically.

That’s what Panda, or any 3-D engine, does. Panda doesn’t pay attention to pixels, so it automatically zooms your images to higher pixel counts or lower pixel counts, according to the size of the window.

In fullscreen mode, changing the window size actually changes the size of your desktop resolution. In windowed mode, changing the window size only makes the window bigger or smaller.


To be honest i didnt know that.Ql.

How do i turn on fullscreen again? :frowning:

Using the setFullscreen method:
Note that however this won’t work if you have already loaded a window. To do this before opening a window, set the “fullscreen” config variable to #t. Check the manual on how to do that.

Alright,edited the Config.prc file.Now it works.A stupid question,though.If ill make an exe the games will be fullscreen in other PCs too,right?

It should, as long as you grab the correct .prc file with the fullscreen changes. (Although, making an exe in python is quite a task all by itself)

Makes me wonder.How would i make a .deb for ubnuntu…

You can make .deb installers using the makepanda build system, included with the source release. If you specify --installer as build option it will automatically build a .deb, .rpm or .exe, depending on what’s available for your systeml

Alright,i have the source release from sourceforge.The makepanda just looks like an ordinary python script.Any topic or tutorial out the on how to use it?

No, the source code from sourceforge is incomplete. You need the “Complete source code” .tar.gz to build panda3d correctly using makepanda.

(1) When you have it, extract it to some directory.
(2) Open a terminal.
(3) Install the prerequisites:

sudo apt-get install build-essential bison libgtk2.0-dev libgl1-mesa-dev libglu1-mesa-dev libgl1-mesa-dev libxft-dev libosmesa-dev flex libssl-dev libpng-dev libtiff-dev python-dev

(4) cd to the panda3d-1.5.3 directory you just extracted.
(5) Type this:

python makepanda/ --everything --installer

(6) Grab a movie and some popcorn.
(7) After some time (30 mins on dualcore here), it should be ready and have created a .deb file in the very same directory. If not, check for an error message.
(8) Install the deb!

Oh, a note: The download page already has ubuntu .debs. So basically you don’t need to build panda3d yourself, but instead can use one of the debs at the download page.

:open_mouth: pro-rsoft,thanks for writing all that,but what i actually ment was to make .debs of the games you make,hehe.

Oh, sorry, I misunderstood. Panda3D provides no script to do that, as far as I know.
See this guide on the ubuntu wiki for how to make a .deb:

Ok,ill have a look.Thankx