Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package cz.ascaria.zoneofuprising.gui;
- import com.jme3.input.KeyInput;
- import com.jme3.input.event.MouseButtonEvent;
- import com.jme3.math.Vector2f;
- import tonegod.gui.controls.buttons.ButtonAdapter;
- import tonegod.gui.controls.extras.ChatBox;
- import tonegod.gui.controls.windows.Window;
- /**
- *
- * @author Ascaria Quynn
- */
- public class MainMenuLayout extends BaseLayout {
- public Window[] getLayout() {
- checkScreen();
- // Create window
- Window win = new Window(screen, new Vector2f(15f, 15f), new Vector2f(600f, 150f));
- win.setWindowIsMovable(false);
- win.setIsResizable(false);
- win.setGlobalAlpha(0.9f);
- win.setWindowTitle("Zone of Uprising");
- screen.addElement(win);
- win.centerToParent();
- // Join server button
- ButtonAdapter serverList = new ButtonAdapter(screen, new Vector2f(50f, 80f)) {
- @Override
- public void onButtonMouseLeftUp(MouseButtonEvent evt, boolean toggled) {
- guiManager.show(ServerListLayout.class);
- }
- };
- serverList.setText("Server list");
- win.addChild(serverList);
- // Settings button
- ButtonAdapter settings = new ButtonAdapter(screen, new Vector2f(170f, 80f)) {
- @Override
- public void onButtonMouseLeftUp(MouseButtonEvent evt, boolean toggled) {
- guiManager.show(SettingsLayout.class);
- }
- };
- settings.setText("Settings");
- win.addChild(settings);
- // Exit button
- ButtonAdapter exit = new ButtonAdapter(screen, new Vector2f(290f, 80f)) {
- @Override
- public void onButtonMouseLeftUp(MouseButtonEvent evt, boolean toggled) {
- app.stop();
- }
- };
- exit.setText("Exit");
- win.addChild(exit);
- return new Window[] { win };
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement