panel.adoc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. = panel
  2. :revnumber: 2.0
  3. :revdate: 2020/07/25
  4. == Panel Class
  5. The Panel class extends Element and, like the Label class, it’s only purpose is to provide:
  6. . The 3 standard constructors as shown in the xref:gui/tonegodgui/quickstart.adoc[Quick Start Guide]
  7. . Default style information
  8. *Constructor 1:*
  9. [source,java]
  10. ----
  11. /** Parameters:
  12. * Screen screen,
  13. * String UID,
  14. * Vector2f position
  15. */
  16. Panel panel = new Panel(screen, "panel", new Vector2f(15, 15));
  17. ----
  18. *Constructor 2:*
  19. [source,java]
  20. ----
  21. /** Additional Parameter:
  22. * Vector2f dimensions */
  23. Panel panel = new Panel(screen, "panel", new Vector2f(15, 15),
  24. new Vector2f(400, 300)
  25. );
  26. ----
  27. *Constructor 3:*
  28. [source,java]
  29. ----
  30. /** Additional Parameters:
  31. * Vector4f resizeBorders,
  32. * String defaultImg
  33. */
  34. Panel panel = new Panel(screen, "panel", new Vector2f(15, 15), new Vector2f(400, 300),
  35. new Vector4f(14,14,14,14),
  36. "tonegod/gui/style/def/Window/panel_x.png"
  37. );
  38. ----
  39. The Panel class creates a resizable, movable panel (xref:gui/tonegodgui/window.adoc[Window] without a dragbar). The entire panel is clickable for moving unless otherwise covered by added child Elements that have not called:
  40. [source,java]
  41. ----
  42. setIgnoreMouse(true);
  43. ----
  44. You can disable any of the default behaviors of the Panel class by using the methods described in the xref:gui/tonegodgui/element.adoc[Element] class.