GMFaderSlider is an easy to use customisable slider.
It inherits from the GMZZSlider class, and is only responsible for graphical specifications. See GMZZSlider for non-graphical properties settings.
Its color can be configured so that it becomes transparent as the value is getting lower. The transparency is independant from the selected scale mapping : it is always linear. This means the lower the color is, the lower the value is relatively to the maximum value. This visual hint is useful when using non-linear scale (a slider at the same position would display different colors on an exponential scale and a logarithmic scale). Setting the minimum transparency to 1 will disable the fading effect.
By default, the slider will display its value, truncated to a certain number.
In some certain cases, the built-in slider scales won't suit your usage, and you will need to post-process the slider value within its action
function. In this case, you should also modify the displayFunction
of the slider so that the displayed value is updated accordingly :
Creates a new instance of GMFaderSlider.
By default, its graphical properties are defined by its associated GMStyle. This means that creating sliders with different colors implies creating multiples GMStyle. The slider color corresponds to the mainColor
property. The font color of the displayed value corresponds to the valueFontColor
property.
a GMFaderSlider instance.
Sets or gets the minimum alpha value that the slider color can reach when the value is equal to min
. Set to 1 to disable the fading effect.
aNumber |
A Float that should be between 0 and 1. |
Sets or gets the size of the slider relative to the widget size.
aNumber |
A Float that should be between 0 and 1. |
Sets or gets wether the value should be displayed.
Sets or gets wether the value should be centered on the widget.
Sets or gets the number the displayed value is truncated to.
Sets or gets the Function that will be used to adapt the displayed value if needed (see above). Set to nil
to disable.
Sets or gets the size of the displayed value font relative to the widget size.
aFloat |
A Float that should be between 0 and 1. |
Sets or gets wether helpers should be displayed.
Deprecated. Use displayHelpers
instead.
Sets or gets the helpers style. Valid values are either \line
or \dot
.
Sets or gets the size of the displayed helpers relative to the widget size. When using \dot
helpers, the value will be clipped if this would cause the dots to overlap.
aNumber |
A Float that should be between 0 and 1. |
Sets or gets wether helpers should be centered on the widget. Only relevant with line
helpers.
Here's a demo of different helpers configuration :
Copy-paste templates :
Amp :
Freq (mapping imprecisions at certains values) :
Panner :
Exp scale (mapping imprecisions at certains values) :