I’ve done a lot of searching today trying to figure this out, is there anyways to make the window start in the center of the screen instead of at a offset from the top left corner?
I think your answer there is a variable in the Config.prc file. I haven’t looked, but check out the possible configuration values. There are a lot for window-related things, and I’m pretty sure that they have something for window positioning too. Hope that helps!
After actually looking, it turns out that I was right! The variable is win-origin, which I pretty sure refers to the top-left hand corner. You can modify the config file on-the-fly after you get data of the screen dimensions, which I don’t quite know how to do, but at least you have a way to a means now.
Also, make sure you make the changes before you start importing Panda’s libraries in the script.
Yeah I’ve scoured all the variables for the config and none of them in there mention anything about having the game window launch in the center of the screen.
I can’t seem to find anything that explains how I can achieve this before the window opens up either unfortunately. Though since it seems like something so useful and basic someone on the forums here has to have an idea on how to achieve it. I’m still new to Panda3D and I’m sure if I was more versed in the code I could know how to do it but since I’m not I was hoping for a bit of help.
As of Panda3D 1.7, can set the window origin to -2, -2. This will centre the window on the screen.
Awesome that’s exactly what I needed.