Added new images and created nearly final version of main menu
This commit is contained in:
parent
d70e438647
commit
ceb9a8d18f
BIN
core/assets/sprites/gplv3_logo.png
Normal file
BIN
core/assets/sprites/gplv3_logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
BIN
core/assets/sprites/menu_background.png
Normal file
BIN
core/assets/sprites/menu_background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 276 KiB |
BIN
core/assets/sprites/osi_logo.png
Normal file
BIN
core/assets/sprites/osi_logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.5 KiB |
BIN
core/assets/sprites/title_logo.png
Normal file
BIN
core/assets/sprites/title_logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.0 KiB |
@ -1,6 +1,8 @@
|
||||
package com.saltosion.gladiator.gui.creators;
|
||||
|
||||
import com.saltosion.gladiator.gui.nodes.ButtonNode;
|
||||
import com.saltosion.gladiator.gui.nodes.GUINode;
|
||||
import com.saltosion.gladiator.gui.nodes.ImageNode;
|
||||
import com.saltosion.gladiator.gui.nodes.TextNode;
|
||||
import com.saltosion.gladiator.util.AppUtil;
|
||||
import com.saltosion.gladiator.util.Name;
|
||||
@ -11,10 +13,15 @@ public class MainMenuGUICreator implements GUICreator {
|
||||
private boolean shouldPlay = false;
|
||||
|
||||
@Override
|
||||
public void create() {
|
||||
TextNode titleText = new TextNode("game_title", "Gladiator Brawler Game Thing!");
|
||||
titleText.setPosition(0.23f, 0.8f);
|
||||
AppUtil.guiManager.getRootNode().addChild(titleText);
|
||||
public void create() {
|
||||
ImageNode backgroundImg = new ImageNode("background_image",
|
||||
SpriteLoader.loadSprite(Name.MENU_BACKGROUND));
|
||||
backgroundImg.setPosition(.5f, .5f);
|
||||
AppUtil.guiManager.getRootNode().addChild(backgroundImg);
|
||||
|
||||
GUINode menuNode = new GUINode("menu-node");
|
||||
menuNode.setPosition(-.5f, -.5f);
|
||||
backgroundImg.addChild(menuNode);
|
||||
|
||||
ButtonNode playButton = new ButtonNode("play_button", SpriteLoader.loadSprite(Name.BUTTON_BIG),
|
||||
SpriteLoader.loadSprite(Name.BUTTON_BIG_HOVER)) {
|
||||
@ -27,11 +34,26 @@ public class MainMenuGUICreator implements GUICreator {
|
||||
shouldPlay = true;
|
||||
}
|
||||
};
|
||||
playButton.setPosition(0.5f, 0.5f);
|
||||
playButton.setPosition(0.4f, 0.5f);
|
||||
TextNode playButtonText = new TextNode("play_button_text", "Play");
|
||||
playButtonText.setPosition(-0.0325f, 0.0175f);
|
||||
playButton.addChild(playButtonText);
|
||||
AppUtil.guiManager.getRootNode().addChild(playButton);
|
||||
menuNode.addChild(playButton);
|
||||
|
||||
ImageNode titleImage = new ImageNode("title_image",
|
||||
SpriteLoader.loadSprite(Name.TITLE_LOGO));
|
||||
titleImage.setPosition(0.4f, 0.8f);
|
||||
menuNode.addChild(titleImage);
|
||||
|
||||
ImageNode gplLogo = new ImageNode("gpl_logo",
|
||||
SpriteLoader.loadSprite(Name.GPLV3_LOGO));
|
||||
gplLogo.setPosition(0.3f, 0.15f);
|
||||
menuNode.addChild(gplLogo);
|
||||
|
||||
ImageNode osiLogo = new ImageNode("osi_logo",
|
||||
SpriteLoader.loadSprite(Name.OSI_LOGO));
|
||||
osiLogo.setPosition(0.5f, 0.15f);
|
||||
menuNode.addChild(osiLogo);
|
||||
}
|
||||
|
||||
public boolean shouldPlay() {
|
||||
|
29
core/src/com/saltosion/gladiator/gui/nodes/ImageNode.java
Normal file
29
core/src/com/saltosion/gladiator/gui/nodes/ImageNode.java
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.saltosion.gladiator.gui.nodes;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.Sprite;
|
||||
import com.saltosion.gladiator.gui.properties.ImageProperty;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author somersby
|
||||
*/
|
||||
public class ImageNode extends GUINode implements ImageProperty {
|
||||
|
||||
private Sprite image;
|
||||
|
||||
public ImageNode(String ID, Sprite image) {
|
||||
super(ID);
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sprite getImage() {
|
||||
return this.image;
|
||||
}
|
||||
|
||||
}
|
@ -18,6 +18,10 @@ public class Name {
|
||||
public static final String BUTTON_BIG_HOVER = "BUTTON_BIG_HOVER";
|
||||
public static final String BUTTON_SMALL = "BUTTON_SMALL";
|
||||
public static final String BUTTON_SMALL_HOVER = "BUTTON_SMALL_HOVER";
|
||||
public static final String TITLE_LOGO = "TITLE_LOGO";
|
||||
public static final String MENU_BACKGROUND = "MENU_BACKGROUND";
|
||||
public static final String GPLV3_LOGO = "GPLV3_LOGO";
|
||||
public static final String OSI_LOGO = "OSI_LOGO";
|
||||
|
||||
public static final String MOVE_LEFT = "MOVE_LEFT";
|
||||
public static final String MOVE_RIGHT = "MOVE_RIGHT";
|
||||
|
@ -24,6 +24,11 @@ public class SpriteLoader {
|
||||
loadTexture(Name.BUTTON_BIG_HOVER, "sprites/buttons/button_big_hover.png");
|
||||
loadTexture(Name.BUTTON_SMALL, "sprites/buttons/button_small.png");
|
||||
loadTexture(Name.BUTTON_SMALL_HOVER, "sprites/buttons/button_small_hover.png");
|
||||
|
||||
loadTexture(Name.TITLE_LOGO, "sprites/title_logo.png");
|
||||
loadTexture(Name.MENU_BACKGROUND, "sprites/menu_background.png");
|
||||
loadTexture(Name.GPLV3_LOGO, "sprites/gplv3_logo.png");
|
||||
loadTexture(Name.OSI_LOGO, "sprites/osi_logo.png");
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user