I’m completely stumped as to how to allow a game user to select a resolution i.e. 800x600, 1024x768, 720p, 1080p, etc. That said, I would be interested in how to allow the user to select a variety of options including sound volumes, draw distances, fog on/off, etc. really anything that would be useful to help the user fine-tune performance. Finally, I’d like this to be simple - a selectable icon, etc, nothing involving messing with init strings or other nerdiness :eek:
Any thoughts? You guys are always so helpful. Thank you!
1)Resolution, use this python function.
2)Sound volumes, use a global variable or load it from a file, and use it as volume.
3)Draw distance, like the above, but i’m not sure if one can change the clipping distance in realtime.
4)Fog, like the 3, and use these functions.
Basicly, just save all the information, and load it, maybe the configparser module can be very usefull.
Just do a button, and execute the script that change what you want.
What you need is:
1)Need a value that can easily be accessed, example, a global variable, the value can be for example: a value between 0 and 2, you can load this value from a file, and when one press a button, change the value in the file. In the bge you can store global variables with two ways: save it in the bge module, or use globalDict, for this type of situation I recommend the globalDict.
2)Why have this value? this value going to be the volume of the sounds, so use a script that change the volume variable of the sound actuator using the global value. If you use python to play the sound, do the same.