reworked gui
This commit is contained in:
parent
0d47e9a399
commit
aa0b0b108d
@ -44,10 +44,36 @@
|
|||||||
<property name="hoverSoundVolume" type="float" value=".5" />
|
<property name="hoverSoundVolume" type="float" value=".5" />
|
||||||
</attributes>
|
</attributes>
|
||||||
<images>
|
<images>
|
||||||
<property name="defaultImg" type="String" value="Gui/Button/button.png" />
|
<property name="defaultImg" type="String" value="Gui/Button/buttonTransparent.png" />
|
||||||
<property name="hoverImg" type="String" value="tonegod/gui/style/def/Button/button_x_h.png" />
|
<property name="hoverImg" type="String" value="Gui/Button/buttonTransparentHover.png" />
|
||||||
<property name="pressedImg" type="String" value="tonegod/gui/style/def/Button/button_x_d.png" />
|
</images>
|
||||||
</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>
|
||||||
<element name="CheckBox">
|
<element name="CheckBox">
|
||||||
<font>
|
<font>
|
||||||
|
|||||||
BIN
ShootingStars/assets/Gui/Button/buttonTransparent.png
Normal file
BIN
ShootingStars/assets/Gui/Button/buttonTransparent.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 240 B |
BIN
ShootingStars/assets/Gui/Button/buttonTransparentHover.png
Normal file
BIN
ShootingStars/assets/Gui/Button/buttonTransparentHover.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 241 B |
39
ShootingStars/assets/Gui/Indicator/Indicator.xml
Normal file
39
ShootingStars/assets/Gui/Indicator/Indicator.xml
Normal 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>
|
||||||
BIN
ShootingStars/assets/Gui/Indicator/indicator_am_x.png
Normal file
BIN
ShootingStars/assets/Gui/Indicator/indicator_am_x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
BIN
ShootingStars/assets/Gui/Indicator/indicator_ol_x.png
Normal file
BIN
ShootingStars/assets/Gui/Indicator/indicator_ol_x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
@ -65,15 +65,12 @@
|
|||||||
</attributes>
|
</attributes>
|
||||||
<images>
|
<images>
|
||||||
<property name="trackImg" type="String" value="Gui/Scrolling/scroll_track_x.png" />
|
<property name="trackImg" type="String" value="Gui/Scrolling/scroll_track_x.png" />
|
||||||
<property name="thumbImg" type="String" value="Gui/Button/button.png" />
|
<property name="thumbImg" type="String" value="Gui/Button/buttonTransparent.png" />
|
||||||
<property name="thumbHoverImg" type="String" value="tonegod/gui/style/def/Button/button_x_h.png" />
|
<property name="thumbHoverImg" type="String" value="Gui/Button/buttonTransparentHover.png" />
|
||||||
<property name="thumbPressedImg" type="String" value="tonegod/gui/style/def/Button/button_x_d.png" />
|
<property name="btnUpImg" type="String" value="Gui/Button/buttonTransparent.png" />
|
||||||
<property name="btnUpImg" type="String" value="Gui/Button/button.png" />
|
<property name="btnUpHoverImg" type="String" value="Gui/Button/buttonTransparentHover.png" />
|
||||||
<property name="btnUpHoverImg" type="String" value="tonegod/gui/style/def/Button/button_x_h.png" />
|
<property name="btnDownImg" type="String" value="Gui/Button/buttonTransparent.png" />
|
||||||
<property name="btnUpPressedImg" type="String" value="tonegod/gui/style/def/Button/button_x_d.png" />
|
<property name="btnDownHoverImg" type="String" value="Gui/Button/buttonTransparentHover.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" />
|
|
||||||
</images>
|
</images>
|
||||||
<effects></effects>
|
<effects></effects>
|
||||||
</element>
|
</element>
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
<style control="TextField" path="tonegod/gui/style/def/TextField/TextField.xml" />
|
<style control="TextField" path="tonegod/gui/style/def/TextField/TextField.xml" />
|
||||||
<style control="TabControl" path="tonegod/gui/style/def/Tabs/Tabs.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="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" />
|
<style control="ColorWheel" path="tonegod/gui/style/def/Common/Extras/ColorWheel.xml" />
|
||||||
</root>
|
</root>
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,7 @@ import tonegod.gui.controls.extras.Indicator;
|
|||||||
import tonegod.gui.controls.lists.Dial;
|
import tonegod.gui.controls.lists.Dial;
|
||||||
import tonegod.gui.controls.text.Label;
|
import tonegod.gui.controls.text.Label;
|
||||||
import tonegod.gui.controls.windows.Panel;
|
import tonegod.gui.controls.windows.Panel;
|
||||||
|
import tonegod.gui.controls.windows.Window;
|
||||||
import tonegod.gui.core.Screen;
|
import tonegod.gui.core.Screen;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -51,6 +52,7 @@ public class GameGUI extends Panel implements Gui{
|
|||||||
private Label lblRemainingTime;
|
private Label lblRemainingTime;
|
||||||
private ScreenHelper screenHelper;
|
private ScreenHelper screenHelper;
|
||||||
private AudioDataManager audioDataManager;
|
private AudioDataManager audioDataManager;
|
||||||
|
private Panel pointsTimePanel;
|
||||||
|
|
||||||
public GameGUI(Screen screen, GameListener listener, ScreenHelper screenHelper, AudioDataManager audioDataManager) {
|
public GameGUI(Screen screen, GameListener listener, ScreenHelper screenHelper, AudioDataManager audioDataManager) {
|
||||||
super(screen, new Vector2f(0f, 0f), new Vector2f(1280f, 720f)); //create for full hd
|
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 startPointx = screenHelper.calcX(537f);
|
||||||
float startPointy = screenHelper.calcY(576f);
|
float startPointy = screenHelper.calcY(576f);
|
||||||
|
|
||||||
float startPointPointsx = screenHelper.calcX(1000f);
|
float startPointPointsx = screenHelper.calcX(1090f);
|
||||||
float startPointPointsy = screenHelper.calcY(10f);
|
float startPointPointsy = screenHelper.calcY(390f);
|
||||||
|
|
||||||
float startPointYMenu = screenHelper.calcY(200f);
|
float startPointYMenu = screenHelper.calcY(200f);
|
||||||
|
|
||||||
@ -120,11 +122,13 @@ public class GameGUI extends Panel implements Gui{
|
|||||||
indOverheat.setMaxValue(100f);
|
indOverheat.setMaxValue(100f);
|
||||||
updateOverhead(0f);
|
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.setFontColor(new ColorRGBA(1f, 0f, 0f, 1f));
|
||||||
lblPoints.setFontSize(screenHelper.calcX(30f));
|
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.setFontColor(new ColorRGBA(1f, 0f, 0f, 1f));
|
||||||
lblRemainingTime.setFontSize(screenHelper.calcX(30f));
|
lblRemainingTime.setFontSize(screenHelper.calcX(30f));
|
||||||
|
|
||||||
@ -132,14 +136,14 @@ public class GameGUI extends Panel implements Gui{
|
|||||||
this.addChild(btnResume);
|
this.addChild(btnResume);
|
||||||
this.addChild(btnMenu);
|
this.addChild(btnMenu);
|
||||||
this.addChild(indOverheat);
|
this.addChild(indOverheat);
|
||||||
this.addChild(lblPoints);
|
pointsTimePanel.addChild(lblPoints);
|
||||||
this.addChild(lblRemainingTime);
|
pointsTimePanel.addChild(lblRemainingTime);
|
||||||
|
this.addChild(pointsTimePanel);
|
||||||
|
|
||||||
btnResume.hide();
|
btnResume.hide();
|
||||||
btnMenu.hide();
|
btnMenu.hide();
|
||||||
indOverheat.hide();
|
indOverheat.hide();
|
||||||
lblPoints.hide();
|
pointsTimePanel.hide();
|
||||||
lblRemainingTime.hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStart() {
|
public void setStart() {
|
||||||
@ -147,8 +151,7 @@ public class GameGUI extends Panel implements Gui{
|
|||||||
btnResume.hide();
|
btnResume.hide();
|
||||||
btnMenu.hide();
|
btnMenu.hide();
|
||||||
indOverheat.show();
|
indOverheat.show();
|
||||||
lblPoints.show();
|
pointsTimePanel.show();
|
||||||
lblRemainingTime.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setWait() {
|
public void setWait() {
|
||||||
@ -156,8 +159,7 @@ public class GameGUI extends Panel implements Gui{
|
|||||||
btnResume.hide();
|
btnResume.hide();
|
||||||
btnMenu.hide();
|
btnMenu.hide();
|
||||||
indOverheat.hide();
|
indOverheat.hide();
|
||||||
lblPoints.hide();
|
pointsTimePanel.hide();
|
||||||
lblRemainingTime.hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showMenu() {
|
public void showMenu() {
|
||||||
@ -165,8 +167,7 @@ public class GameGUI extends Panel implements Gui{
|
|||||||
btnResume.show();
|
btnResume.show();
|
||||||
btnMenu.show();
|
btnMenu.show();
|
||||||
indOverheat.hide();
|
indOverheat.hide();
|
||||||
lblPoints.hide();
|
pointsTimePanel.hide();
|
||||||
lblRemainingTime.hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resumeGame() {
|
public void resumeGame() {
|
||||||
@ -174,8 +175,7 @@ public class GameGUI extends Panel implements Gui{
|
|||||||
btnResume.hide();
|
btnResume.hide();
|
||||||
btnMenu.hide();
|
btnMenu.hide();
|
||||||
indOverheat.show();
|
indOverheat.show();
|
||||||
lblPoints.show();
|
pointsTimePanel.show();
|
||||||
lblRemainingTime.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void attach() {
|
public void attach() {
|
||||||
|
|||||||
@ -76,8 +76,8 @@ public class HighscoreGUI extends BackgroundedGui implements Gui {
|
|||||||
float labelFontSize = screenHelper.calcX(20f);
|
float labelFontSize = screenHelper.calcX(20f);
|
||||||
|
|
||||||
float buttonHeight = screenHelper.calcY(40f);
|
float buttonHeight = screenHelper.calcY(40f);
|
||||||
float buttonWidth = screenHelper.calcX(153f);
|
float buttonWidth = screenHelper.calcX(180f);
|
||||||
float buttonFontSize = screenHelper.calcX(20f);
|
float buttonFontSize = screenHelper.calcX(18f);
|
||||||
|
|
||||||
List<Score> highscores = highscoreManager.getScores();
|
List<Score> highscores = highscoreManager.getScores();
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ public class HighscoreGUI extends BackgroundedGui implements Gui {
|
|||||||
|
|
||||||
drawHighscores(highscores);
|
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
|
@Override
|
||||||
public void onButtonMouseLeftUp(MouseButtonEvent evt, boolean toggled) {
|
public void onButtonMouseLeftUp(MouseButtonEvent evt, boolean toggled) {
|
||||||
listener.back();
|
listener.back();
|
||||||
|
|||||||
@ -55,9 +55,10 @@ public class LoadingGui extends BackgroundedGui implements Gui {
|
|||||||
|
|
||||||
indProgress = new IndicatorBase(screen, new Vector2f(startPointx, startPointy),
|
indProgress = new IndicatorBase(screen, new Vector2f(startPointx, startPointy),
|
||||||
new Vector2f(screenHelper.calcX(200f), screenHelper.calcY(30f)), Indicator.Orientation.HORIZONTAL);
|
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.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 = new Label(screen, new Vector2f(startPointx, startPointy + distancePogressbarLabely), new Vector2f(screenHelper.calcX(200f), screenHelper.calcY(30f)));
|
||||||
lblStatus.setTextAlign(BitmapFont.Align.Center);
|
lblStatus.setTextAlign(BitmapFont.Align.Center);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user