Older Newer
Mon, 18 Nov 2019 03:40:38 . . . . SyneRyder


Changes by last author:

Added:
= setCtlGamma =

== Syntax ==

int setCtlGamma(int num, int gamma)

== Arguments ==

:num

::The index number of the user control you want to change

:gamma

::A value between 1 and 1000. Default = 100

== Return ==

1 if the function completed correctly, 0 if the control is not a STANDARD or SCROLLBAR control, -1 if the given control number is not a valid control.

== Description ==

Changes how the minimum and maximum values of a STANDARD or SCROLLBAR control are spread out across the slider control. Changing the gamma value is useful if you want the user to have more precision at one end of the slider values - for example, a blur where the user needs precision over small blur radius values between 1 - 2 pixels, but the difference between very large radius values doesn't matter so much. The default gamma value is 100, where the control value changes linearly across the entire slider.

== Example ==

<code>

%fml

ctl[3]: CHECKBOX, Text="Higher Gamma"

ctl[4]: STANDARD, Text="Control", gamma=50, divisor=10

OnCtl(n): {

// If Checkbox value changed

if (n == 3) {

if (ctl(3) == true) {

// Change slowly at start

// quickly at end

setCtlGamma(4, 500);

}

else {

// Change quickly at start

// slowly at end

setCtlGamma(4, 50);

}

return true;

}

return false;

}

</code>

== See Also ==

getCtlDivisor