GMSymbol2DSlider is an easy to use customisable slider.
It inherits from the GMZZ2DSlider class, and is only responsible for graphical specifications. See GMZZSlider and GMZZ2DSlider for non-graphical properties settings.
This class is an extension of the GMSymbolSlider class. It retains the same principle, but for two axis at once instead of one. As such, you should read the GMSymbolSlider class documentation first, as only differences between those two classes are documented here.
The \dot
helper style is pretty straightforward and will display a grid composed of dots on the view. The \centerValues
parameter is ignored in this case :
The \line
helper style allows several configurations.
If the helpersRatio
parameter is set to 1
, it will then display a grid on the view, and render the \centerValues
parameter useless :
Otherwise, it becomes possible to center the helpers on the view :
This can be used to differentiate the scales polarities :
Creates a new instance of GMSymbol2DSlider.
By default, its graphical properties are defined by its associated GMStyle. This means that creating sliders with different colors implies creating multiples GMStyle. The font color of the displayed value corresponds to the valueFontColor
property.
a GMSymbol2DSlider instance.
Sets or gets wether the handle position should be highlighted with lines on each view axis.
Deprecated. Use displayLine
instead.
Sets or gets the Function that will be used to adapt the value displayed on the horizontal axis if needed. Set to nil
to disable.
Sets or gets the Function that will be used to adapt the value displayed on the vertical axis if needed. Set to nil
to disable.
Sets a path to a valid SVG file to be displayed on top of the widget's background.
Sets or gets the background SVG's size ratio relative to the widget size.
Frees the current background SVG, allowing garbage collection.
See the GMSymbolSlider class documentation for those methods.
2D sliders are amazing to create simple drone instruments :
In the context of Frequency Modulation, using a 2D slider allows to control the two parameters at once : the modulators frequency ratio, and the modulators index.
In this example, helpers are configured so that if one holds CTRL + SHIFT, the frequency ratio (on the vertical axis) will snap to a 'natural' ratio (0.25, 0.5, 1, 2, etc), thus producing an harmonic sound.
Once the desired ratio has been set, one can hold the CTRL key (but not the SHIFT key) to modify the index value without modifying the ratio value :