12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- = alertbox
- :author:
- :revnumber:
- :revdate: 2016/03/17 20:48
- :relfileprefix: ../../../
- :imagesdir: ../../..
- ifdef::env-github,env-browser[:outfilesuffix: .adoc]
- == AlertBox Class
- The AlertBox class extends Window, adding a scroll area for displaying messages, as well as a configurable button for closing the AlertBox.
- It utilizes the 3 standard constructors as shown in the <<jme3/contributions/tonegodgui/quickstart#,Quick Start Guide>>.
- *Constructor 1:*
- [source,java]
- ----
- /** Parameters:
- * Screen screen,
- * String UID,
- * Vector2f position
- */
-
- AlertBox alert = new AlertBox(screen, “alert”, new Vector2f(15, 15));
- ----
- *Constructor 2:*
- [source,java]
- ----
- /** Additional Parameter:
- * Vector2f dimensions */
-
- AlertBox alert = new AlertBox(screen, “alert”, new Vector2f(15, 15),
- new Vector2f(400, 300)
- );
- ----
- *Constructor 3:*
- [source,java]
- ----
- /** Additional Parameters:
- * Vector4f resizeBorders,
- * String defaultImg
- */
-
- AlertBox alert = new AlertBox(screen, “alert”, new Vector2f(15, 15), new Vector2f(400, 300),
- new Vector4f(14,14,14,14),
- “tonegod/gui/style/def/Window/panel_x.png”
- );
- ----
- === Abstract Event Methods:
- [source,java]
- ----
- public void onButtonOkPressed(MouseButtonEvent evt, boolean toggled);
- ----
- === AlertBox specific methods:
- [source,java]
- ----
- alert.setMsg(String text); // Set the alert message
- alert.setButtonOkText(String text); // Sets the text for the ok button of the AlertBox
- ----
|