Gamma Slider GUI Problem (SOLVED)

Started by Dualnames, Tue 20/02/2007 22:26:07

Previous topic - Next topic

Dualnames

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.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Rui 'Trovatore' Pires

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.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Dualnames

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.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Scorpiorus

The script code:

just before you show a GUI with Gamma Control Slider:

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



on sliderGamma change:

Code: ags


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)

monkey0506

You can simplify the first code snippet to just:

Code: ags
sliderGamma.Enabled = System.SupportsGammaControl;


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

Dualnames

Quote from: monkey_05_06 on Wed 21/02/2007 00:08:07
You can simplify the first code snippet to just:

Code: ags
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.





Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SMF spam blocked by CleanTalk