Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.01 KB | None | 0 0
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package cz.ascaria.zoneofuprising.gui;
  6.  
  7. import com.jme3.input.KeyInput;
  8. import com.jme3.input.event.MouseButtonEvent;
  9. import com.jme3.math.Vector2f;
  10. import tonegod.gui.controls.buttons.ButtonAdapter;
  11. import tonegod.gui.controls.extras.ChatBox;
  12. import tonegod.gui.controls.windows.Window;
  13.  
  14. /**
  15.  *
  16.  * @author Ascaria Quynn
  17.  */
  18. public class MainMenuLayout extends BaseLayout {
  19.  
  20.     public Window[] getLayout() {
  21.         checkScreen();
  22.         // Create window
  23.         Window win = new Window(screen, new Vector2f(15f, 15f), new Vector2f(600f, 150f));
  24.         win.setWindowIsMovable(false);
  25.         win.setIsResizable(false);
  26.         win.setGlobalAlpha(0.9f);
  27.         win.setWindowTitle("Zone of Uprising");
  28.         screen.addElement(win);
  29.         win.centerToParent();
  30.  
  31.         // Join server button
  32.         ButtonAdapter serverList = new ButtonAdapter(screen, new Vector2f(50f, 80f)) {
  33.             @Override
  34.             public void onButtonMouseLeftUp(MouseButtonEvent evt, boolean toggled) {
  35.                 guiManager.show(ServerListLayout.class);
  36.             }
  37.         };
  38.         serverList.setText("Server list");
  39.         win.addChild(serverList);
  40.  
  41.         // Settings button
  42.         ButtonAdapter settings = new ButtonAdapter(screen, new Vector2f(170f, 80f)) {
  43.             @Override
  44.             public void onButtonMouseLeftUp(MouseButtonEvent evt, boolean toggled) {
  45.                 guiManager.show(SettingsLayout.class);
  46.             }
  47.         };
  48.         settings.setText("Settings");
  49.         win.addChild(settings);
  50.  
  51.         // Exit button
  52.         ButtonAdapter exit = new ButtonAdapter(screen, new Vector2f(290f, 80f)) {
  53.             @Override
  54.             public void onButtonMouseLeftUp(MouseButtonEvent evt, boolean toggled) {
  55.                 app.stop();
  56.             }
  57.         };
  58.         exit.setText("Exit");
  59.         win.addChild(exit);
  60.  
  61.         return new Window[] { win };
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement