Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: mmpn on November 09, 2005, 10:11:36 AM

Title: How make sound volume, gamma, resulation changer &... in option menu?
Post by: mmpn on November 09, 2005, 10:11:36 AM
Hello All,

How can i make sound volume, gamma, resulation changer & ... in option menu page of my game?

And save this setting for next game starting, in registry or ...

Thank's.
Title: Re: How make sound volume, gamma, resulation changer &... in option menu?
Post by: Jerrot on November 10, 2005, 01:46:41 AM
Hiya,

Of course you can expand that menu, open other windows with controls, etc., but that's a wide topic.
I would recommend you to check the WME-Help for this in the chapter "Inside a game"->"User interface layer"->"Windows & controls".
It describes the files you can find in your project (or the WME-Demo) in the directory "data\interface\system".

If you have some more detailled problem about that, you are welcome to ask more about it.

But a note, you wrote:

How can i make sound volume, gamma, resulation changer & ... in option menu page of my game?
And save this setting for next game starting, in registry or ...

Remember - WME is not a 3D engine. There is no gamma adjusting, nor can you change the resolution in runtime (even if you could - the backgrounds are 2D, so you would have to create everything for every resolution! In general 2d/2.5d games decide for one fixed resolution).
You can change the sound volume though by using SetSoundVolume or SetMusicVolume, they should be called in the event handler you trigger from your slider, button or whatever you define in your options window. (see above).

You can also save those values in the registry if necessary - these fine methods do the whole job (you find them in the script reference about the game object as well):

RegWriteNumber - Writes a given number to the Windows Registry.
RegWriteString - Writes a given string to the Windows Registry.
RegReadNumber - Reads a numeric value from the Windows Registry.
RegReadString - Reads a string value from the Windows Registry.

Sorry for pointing to the docs all the time, but the question is just too general to confront you with a lot of source code... :)

Good luck!
Title: Re: How make sound volume, gamma, resulation changer &... in option menu?
Post by: Mnemonic on November 10, 2005, 08:38:43 AM
Also, you can see an example of settings dialog allowing you to change volume using sliders in Fred Demo by McCoy. The source code can be downloaded here: http://master.math.upatras.gr/~odnorf/dreams/?show=downloads
Title: Re: How make sound volume, gamma, resulation changer &... in option menu?
Post by: mmpn on November 12, 2005, 07:31:43 AM
Thank's for all...
Title: Re: How make sound volume, gamma, resulation changer &... in option menu?
Post by: Ennio on March 22, 2011, 02:28:26 PM
Hi all,
I'm sorry for the up of this old topic, but it's exactly what I'm searching for, i need to make an option menu with some setting (like sound and music).
The link to the source code posted by mnemonic doesn't work anymore... can anyone help me?
Thank you!