Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Dualnames on Tue 20/02/2007 22:26:07

Title: Gamma Slider GUI Problem (SOLVED)
Post by: Dualnames on Tue 20/02/2007 22:26:07
Since I am not quite familiar with GUi's code and functions I read all the help and tried quite a lot of stuff but it doesn't work the way I want to.

I need a slider to change the Gamma.
I've made the Music Slider but I can't make this one.

Please help.
Title: Re: Gamma Slider GUI
Post by: Rui 'Trovatore' Pires on Tue 20/02/2007 22:27:49
It works the same way as the music slider. You say, in the slider script, "SetGamma(sldGamma.Value)", or something of the sort. Adding a little check first to see if it's supported.
Title: Re: Gamma Slider GUI
Post by: Dualnames on Tue 20/02/2007 22:30:00
Quote from: Rui "Trovatore" Pires on Tue 20/02/2007 22:27:49
It works the same way as the music slider. You say, in the slider script, "SetGamma(sldGamma.Value)", or something of the sort. Adding a little check first to see if it's supported.

Thank you. I could not find the similar to SetMusicMasterVolume(sldvolume,value);
System gamma = ; did not work for obvious reason.
Title: Re: Gamma Slider GUI Problem
Post by: Scorpiorus on Tue 20/02/2007 23:09:05
The script code:

just before you show a GUI with Gamma Control Slider:

if (System.SupportsGammaControl)
{
Ã,  Ã,  sliderGamma.Enabled = true;
}
else
{
Ã,  Ã,  sliderGamma.Enabled = false;
}



on sliderGamma change:



System.Gamma = sliderGamma.Value;



where sliderGamma is a script name of gamma slider GUI control.


The System.SupportsGammaControl check is recommended as gamma changing will not always work (such as it may not work in windowed mode).

And make sure to calibrate Slider.Min/Max/Value properties in the AGS editor to match System.Gamma's range of values (0..200 and set at 100 by default)
Title: Re: Gamma Slider GUI Problem
Post by: monkey0506 on Wed 21/02/2007 00:08:07
You can simplify the first code snippet to just:

sliderGamma.Enabled = System.SupportsGammaControl;

It works the same way, but it's simpler to write out.
Title: Re: Gamma Slider GUI Problem
Post by: Dualnames on Thu 22/02/2007 22:20:05
Quote from: monkey_05_06 on Wed 21/02/2007 00:08:07
You can simplify the first code snippet to just:

sliderGamma.Enabled = System.SupportsGammaControl;

It works the same way, but it's simpler to write out.

The code I used was the following

if (System.SupportsGammaControl = true) {
    SystemGamma == sldGamma.Value
}
else
{
    sldGamma.Enabled = false;
}

Thanks all.