Start up / Options Menu

Hi,

After some advice really.

I’m looking to create an options/startup menu for my game, but don’t really know where to start or how to go about it.

What I would like to start off with is on start up have an option that the user can select to either play the game in full screen, or in a window.

My question is what is the best way of doing this? Would it to be have a main.py file with the options which link to another file depending on what the user clicked on (e.g. full.py for full screen, and window.py for window), or is there a simpler way to do this.

Also please bear in mind that once I have this working, I’ll be looking to add more options (like sound on/off and others which I haven’t thought of yet), so any suggestions that are put my way, I would appreciate that this was beared in mind. (Or put another way, whatever suggestions that are posted, allow for expansion of options)

Hope that this makes sense. I’m sure that it is possible, but just got no idea how to go about doing it!

Please advise.

Many Thanks

Tony

I think you’ll have to write a program which takes your parameters like -f for fullscreen,… and do what you want it to do.
Then you’ll have to add entries to the start menu with these parameters
If you want to I can explain it a bit more detailed

Martin

you could specify a tk window that starts up before panda. The tk window would have th option to choose fullscreen or windowed mode. You would use the tk run loop so you wouldn’t have to actually start panda until an option was chosen.

I guess its sort of a hack, but it would work.

Hi,

thanks for all your replies. all apricciated.

is there any chance of an example or some example code please to use as an example and to get me started please.

many thanks
Tony

I’ll try

main.py

from pandac.PandaModules import ConfigVariableBool
from pandac.PandaModules import ConfigVariableString
from optparse import OptionParser()

parser= OptionParser()

parser.add_option("-f", "--fullscreen", dest="fullscreen", default=False,
  action="store_true", help="runs game in fullscreen mode" )

(options, args) = parser.parse_args()

if options['fullscreen'] :
  ConfigVariableBool("fullscreen").setValue(1)

import direct.directbase.DirectStart
.....

In the startmenu you have to add an entry with (I don’t know if this options are correct, I use a german windows)
Destination: ppython.exe main.py --fullscreen
Execute in:
Name: Run in fullscreen

Hope this is all correct and helpfull
Martin