reworked gui

This commit is contained in:
TheCodeBoat 2014-02-11 21:06:20 +01:00
parent 0d47e9a399
commit aa0b0b108d
11 changed files with 98 additions and 35 deletions

View File

@ -44,10 +44,36 @@
<property name="hoverSoundVolume" type="float" value=".5" />
</attributes>
<images>
<property name="defaultImg" type="String" value="Gui/Button/button.png" />
<property name="hoverImg" type="String" value="tonegod/gui/style/def/Button/button_x_h.png" />
<property name="pressedImg" type="String" value="tonegod/gui/style/def/Button/button_x_d.png" />
</images>
<property name="defaultImg" type="String" value="Gui/Button/buttonTransparent.png" />
<property name="hoverImg" type="String" value="Gui/Button/buttonTransparentHover.png" />
</images>
<effects>
<property name="event0" type="Effect">
<event value="Hover" />
<effect value="Pulse" />
<speed value=".3" />
</property>
<property name="event1" type="Effect">
<event value="Press" />
<effect value="ImageSwap" />
<speed value="0" />
</property>
<property name="event2" type="Effect">
<event value="LoseFocus" />
<effect value="ImageSwap" />
<speed value="0" />
</property>
<property name="event3" type="Effect">
<event value="TabFocus" />
<effect value="PulseColor" />
<speed value=".3" />
</property>
<property name="event4" type="Effect">
<event value="LoseTabFocus" />
<effect value="ColorSwap" />
<speed value="0" />
</property>
</effects>
</element>
<element name="CheckBox">
<font>

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<element name="Indicator">
<font>
<property name="fontSize" type="float" value="16" />
<property name="fontColor" type="ColorRGBA">
<r value="1" />
<g value="1" />
<b value="1" />
<a value="1" />
</property>
<property name="textAlign" type="String" value="Center" />
<property name="textVAlign" type="String" value="Center" />
<property name="textWrap" type="String" value="NoWrap" />
<property name="textPadding" type="float" value="0" />
</font>
<attributes>
<property name="resizeBorders" type="Vector4f">
<x value="7" />
<y value="7" />
<z value="7" />
<w value="7" />
</property>
<property name="minSize" type="Vector2f">
<x value="40" />
<y value="20" />
</property>
<property name="defaultSize" type="Vector2f">
<x value="150" />
<y value="20" />
</property>
</attributes>
<images>
<property name="defaultImg" type="String" value="Gui/Indicator/indicator_ol_x.png" />
<property name="alphaImg" type="String" value="Gui/Indicator/indicator_am_x.png" />
</images>
<effects></effects>
</element>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -65,15 +65,12 @@
</attributes>
<images>
<property name="trackImg" type="String" value="Gui/Scrolling/scroll_track_x.png" />
<property name="thumbImg" type="String" value="Gui/Button/button.png" />
<property name="thumbHoverImg" type="String" value="tonegod/gui/style/def/Button/button_x_h.png" />
<property name="thumbPressedImg" type="String" value="tonegod/gui/style/def/Button/button_x_d.png" />
<property name="btnUpImg" type="String" value="Gui/Button/button.png" />
<property name="btnUpHoverImg" type="String" value="tonegod/gui/style/def/Button/button_x_h.png" />
<property name="btnUpPressedImg" type="String" value="tonegod/gui/style/def/Button/button_x_d.png" />
<property name="btnDownImg" type="String" value="Gui/Button/button.png" />
<property name="btnDownHoverImg" type="String" value="tonegod/gui/style/def/Button/button_x_h.png" />
<property name="btnDownPressedImg" type="String" value="tonegod/gui/style/def/Button/button_x_d.png" />
<property name="thumbImg" type="String" value="Gui/Button/buttonTransparent.png" />
<property name="thumbHoverImg" type="String" value="Gui/Button/buttonTransparentHover.png" />
<property name="btnUpImg" type="String" value="Gui/Button/buttonTransparent.png" />
<property name="btnUpHoverImg" type="String" value="Gui/Button/buttonTransparentHover.png" />
<property name="btnDownImg" type="String" value="Gui/Button/buttonTransparent.png" />
<property name="btnDownHoverImg" type="String" value="Gui/Button/buttonTransparentHover.png" />
</images>
<effects></effects>
</element>

View File

@ -15,7 +15,7 @@
<style control="TextField" path="tonegod/gui/style/def/TextField/TextField.xml" />
<style control="TabControl" path="tonegod/gui/style/def/Tabs/Tabs.xml" />
<style control="ChatBox" path="tonegod/gui/style/def/ChatBox/ChatBox.xml" />
<style control="Indicator" path="tonegod/gui/style/def/Common/Extras/Indicator.xml" />
<style control="Indicator" path="Gui/Indicator/Indicator.xml" />
<style control="ColorWheel" path="tonegod/gui/style/def/Common/Extras/ColorWheel.xml" />
</root>

View File

@ -33,6 +33,7 @@ import tonegod.gui.controls.extras.Indicator;
import tonegod.gui.controls.lists.Dial;
import tonegod.gui.controls.text.Label;
import tonegod.gui.controls.windows.Panel;
import tonegod.gui.controls.windows.Window;
import tonegod.gui.core.Screen;
/**
@ -51,6 +52,7 @@ public class GameGUI extends Panel implements Gui{
private Label lblRemainingTime;
private ScreenHelper screenHelper;
private AudioDataManager audioDataManager;
private Panel pointsTimePanel;
public GameGUI(Screen screen, GameListener listener, ScreenHelper screenHelper, AudioDataManager audioDataManager) {
super(screen, new Vector2f(0f, 0f), new Vector2f(1280f, 720f)); //create for full hd
@ -67,8 +69,8 @@ public class GameGUI extends Panel implements Gui{
float startPointx = screenHelper.calcX(537f);
float startPointy = screenHelper.calcY(576f);
float startPointPointsx = screenHelper.calcX(1000f);
float startPointPointsy = screenHelper.calcY(10f);
float startPointPointsx = screenHelper.calcX(1090f);
float startPointPointsy = screenHelper.calcY(390f);
float startPointYMenu = screenHelper.calcY(200f);
@ -120,11 +122,13 @@ public class GameGUI extends Panel implements Gui{
indOverheat.setMaxValue(100f);
updateOverhead(0f);
lblPoints = new Label(screen, new Vector2f(startPointPointsx, startPointPointsy), new Vector2f(screenHelper.calcX(275f), screenHelper.calcY(180f)));
pointsTimePanel = new Panel(screen, new Vector2f(startPointPointsx, startPointPointsy), new Vector2f(screenHelper.calcX(180f), screenHelper.calcY(65f)));
lblPoints = new Label(screen, new Vector2f(screenHelper.calcX(5f), 0), new Vector2f(screenHelper.calcX(150f), screenHelper.calcY(30f)));
lblPoints.setFontColor(new ColorRGBA(1f, 0f, 0f, 1f));
lblPoints.setFontSize(screenHelper.calcX(30f));
lblRemainingTime = new Label(screen, new Vector2f(startPointPointsx, startPointPointsy), new Vector2f(screenHelper.calcX(275f), screenHelper.calcY(240f)));
lblRemainingTime = new Label(screen, new Vector2f(screenHelper.calcX(5f), screenHelper.calcX(25f)), new Vector2f(screenHelper.calcX(150f), screenHelper.calcY(30f)));
lblRemainingTime.setFontColor(new ColorRGBA(1f, 0f, 0f, 1f));
lblRemainingTime.setFontSize(screenHelper.calcX(30f));
@ -132,14 +136,14 @@ public class GameGUI extends Panel implements Gui{
this.addChild(btnResume);
this.addChild(btnMenu);
this.addChild(indOverheat);
this.addChild(lblPoints);
this.addChild(lblRemainingTime);
pointsTimePanel.addChild(lblPoints);
pointsTimePanel.addChild(lblRemainingTime);
this.addChild(pointsTimePanel);
btnResume.hide();
btnMenu.hide();
indOverheat.hide();
lblPoints.hide();
lblRemainingTime.hide();
pointsTimePanel.hide();
}
public void setStart() {
@ -147,8 +151,7 @@ public class GameGUI extends Panel implements Gui{
btnResume.hide();
btnMenu.hide();
indOverheat.show();
lblPoints.show();
lblRemainingTime.show();
pointsTimePanel.show();
}
public void setWait() {
@ -156,8 +159,7 @@ public class GameGUI extends Panel implements Gui{
btnResume.hide();
btnMenu.hide();
indOverheat.hide();
lblPoints.hide();
lblRemainingTime.hide();
pointsTimePanel.hide();
}
public void showMenu() {
@ -165,8 +167,7 @@ public class GameGUI extends Panel implements Gui{
btnResume.show();
btnMenu.show();
indOverheat.hide();
lblPoints.hide();
lblRemainingTime.hide();
pointsTimePanel.hide();
}
public void resumeGame() {
@ -174,8 +175,7 @@ public class GameGUI extends Panel implements Gui{
btnResume.hide();
btnMenu.hide();
indOverheat.show();
lblPoints.show();
lblRemainingTime.show();
pointsTimePanel.show();
}
public void attach() {

View File

@ -76,8 +76,8 @@ public class HighscoreGUI extends BackgroundedGui implements Gui {
float labelFontSize = screenHelper.calcX(20f);
float buttonHeight = screenHelper.calcY(40f);
float buttonWidth = screenHelper.calcX(153f);
float buttonFontSize = screenHelper.calcX(20f);
float buttonWidth = screenHelper.calcX(180f);
float buttonFontSize = screenHelper.calcX(18f);
List<Score> highscores = highscoreManager.getScores();
@ -99,7 +99,7 @@ public class HighscoreGUI extends BackgroundedGui implements Gui {
drawHighscores(highscores);
Button btnBack = new ButtonBase(screen, new Vector2f(startPointx + screenHelper.calcX(1060f), startPointy + screenHelper.calcY(622.8f)), new Vector2f(buttonWidth, buttonHeight)) {
Button btnBack = new ButtonBase(screen, new Vector2f(startPointx + screenHelper.calcX(1060f), startPointy + screenHelper.calcY(622.8f)), new Vector2f(screenHelper.calcX(153f), buttonHeight)) {
@Override
public void onButtonMouseLeftUp(MouseButtonEvent evt, boolean toggled) {
listener.back();

View File

@ -55,9 +55,10 @@ public class LoadingGui extends BackgroundedGui implements Gui {
indProgress = new IndicatorBase(screen, new Vector2f(startPointx, startPointy),
new Vector2f(screenHelper.calcX(200f), screenHelper.calcY(30f)), Indicator.Orientation.HORIZONTAL);
indProgress.setDisplayValues();
indProgress.setIndicatorImage("Gui/Indicator/indicator_ol_x.png");
indProgress.setDisplayValues();
indProgress.setMaxValue(LoadingProgress.getProgressCount());
indProgress.setIndicatorColor(ColorRGBA.Black);
indProgress.setIndicatorColor(ColorRGBA.Black);
lblStatus = new Label(screen, new Vector2f(startPointx, startPointy + distancePogressbarLabely), new Vector2f(screenHelper.calcX(200f), screenHelper.calcY(30f)));
lblStatus.setTextAlign(BitmapFont.Align.Center);