password.adoc 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. = password
  2. :revnumber: 2.0
  3. :revdate: 2020/07/25
  4. == Password Class
  5. The password class extends TextField and adds the ability to set a mask character.
  6. It uses the standard 3 constructors as shown in the xref:gui/tonegodgui/quickstart.adoc[Quick Start Guide].
  7. *Constructor 1:*
  8. [source,java]
  9. ----
  10. /** Parameters:
  11. * Screen screen,
  12. * String UID,
  13. * Vector2f position
  14. */
  15. Password pw = new Password(screen, "password", new Vector2f(15, 15));
  16. ----
  17. *Constructor 2:*
  18. [source,java]
  19. ----
  20. /** Additional Parameter:
  21. * Vector2f dimensions */
  22. Password pw = new Password(screen, "password", new Vector2f(15, 15),
  23. new Vector2f(150, 25)
  24. );
  25. ----
  26. *Constructor 3:*
  27. [source,java]
  28. ----
  29. /** Additional Parameters:
  30. * Vector4f resizeBorders,
  31. * String defaultImg
  32. */
  33. Password pw = new Password(screen, "password", new Vector2f(15, 15), new Vector2f(150, 25),
  34. new Vector4f(3,3,3,3),
  35. "tonegod/gui/style/def/TextField/text_field_x.png"
  36. );
  37. ----
  38. === Password specific methods:
  39. [source,java]
  40. ----
  41. pw.setMask(char mask);
  42. pw.getMask(); // Returns mask character as a String
  43. ----