| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- = slider
- :revnumber: 2.0
- :revdate: 2020/07/25
- == Slider Class
- The Slider class provides the same 3 common constructors shown in the xref:gui/tonegodgui/quickstart.adoc[Quick Start Guide] with the addition of two extra parameters.
- * The orientation of the Slider
- * A boolean flag telling the control whether or not the track should "`surround`" the thumb.
- The additional parameter are appended to the existing parameter list for all 3 constructors, like so:
- [source,java]
- ----
- /**
- * Parameters:
- * Screen screen
- * String UID
- * Vector2f position
- * Slider.Orientation orientation
- * boolean trackSurroundsThumb
- */
- Slider slider1 = new Slider(
- screen,
- "SomeID",
- new Vector2f(15, 15),
- Slider.Orientation.HORIZONTAL,
- true
- );
- ----
- === Abstract Event Methods:
- [source,java]
- ----
- public void onChange(int selectedIndex, String value);
- ----
- === Methods specific to the Slider class:
- [source,java]
- ----
- // Adding/removing step values
- slider1.addStepValue(String value);
- slider1.removeStepValue(String value);
- // Selected values
- slider1.getSelectedIndex();
- ----
- You can set the select Sliders position and selected value using:
- [source,java]
- ----
- slider1.setSelectedIndex(int selectedIndex)
- ----
|