dial.adoc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. = dial
  2. :revnumber: 2.0
  3. :revdate: 2020/07/25
  4. == Dial Class
  5. The Dial class provides:
  6. * A rotating knob for selecting step values
  7. The Dial class provides the standard 3 common constructors as sown in the xref:gui/tonegodgui/quickstart.adoc[Quick Start Guide].
  8. *Constructor 1:*
  9. [source,java]
  10. ----
  11. /** Parameters:
  12. * Screen screen,
  13. * String UID,
  14. * Vector2f position
  15. */
  16. Dial dial = new Dial(screen, "dial", new Vector2f(15, 15));
  17. ----
  18. *Constructor 2:*
  19. [source,java]
  20. ----
  21. /** Additional Parameter:
  22. * Vector2f dimensions */
  23. Dial dial = new Dial(screen, "dial", new Vector2f(15, 15),
  24. new Vector2f(35, 35)
  25. );
  26. ----
  27. *Constructor 3:*
  28. [source,java]
  29. ----
  30. /** Additional Parameters:
  31. * Vector4f resizeBorders,
  32. * String defaultImg
  33. */
  34. Dial dial = new Dial(screen, "dial", new Vector2f(15, 15), new Vector2f(35, 35),
  35. new Vector4f(0,0,0,0),
  36. "tonegod/gui/style/def/Dial/dial_x.png"
  37. );
  38. ----
  39. === Abstract Event Methods:
  40. [source,java]
  41. ----
  42. public void onChange(int selectedIndex, String value);
  43. ----
  44. === Methods specific to the Dial class:
  45. [source,java]
  46. ----
  47. // Adding removing list info
  48. dial.addStepValue(String value);
  49. dial.removeStepValue(String value);
  50. // Retrieval of current selected step
  51. dial.getSelectedIndex();
  52. ----