From 4be216938c27ed9a9f283b103fd79540d610a9ae Mon Sep 17 00:00:00 2001 From: TheCodeBoat Date: Tue, 11 Feb 2014 21:44:57 +0100 Subject: [PATCH] fixed buttons --- ShootingStars/assets/Gui/Button/Button.xml | 2 +- .../shootingstars/gui/FileMetaInfoGUI.java | 2 ++ .../org/wyrez/shootingstars/gui/GameGUI.java | 29 ++++++++++--------- .../wyrez/shootingstars/gui/HighscoreGUI.java | 2 ++ .../wyrez/shootingstars/gui/LoadingGui.java | 1 - .../org/wyrez/shootingstars/gui/MenuGUI.java | 4 +++ .../wyrez/shootingstars/gui/OptionsGUI.java | 2 ++ .../shootingstars/gui/SelectTrackGUI.java | 3 ++ .../shootingstars/gui/YTDownloadGUI.java | 2 ++ 9 files changed, 32 insertions(+), 15 deletions(-) diff --git a/ShootingStars/assets/Gui/Button/Button.xml b/ShootingStars/assets/Gui/Button/Button.xml index 319a554..5a516b1 100644 --- a/ShootingStars/assets/Gui/Button/Button.xml +++ b/ShootingStars/assets/Gui/Button/Button.xml @@ -10,7 +10,7 @@ - + diff --git a/ShootingStars/src/org/wyrez/shootingstars/gui/FileMetaInfoGUI.java b/ShootingStars/src/org/wyrez/shootingstars/gui/FileMetaInfoGUI.java index f7af32f..3a904ab 100644 --- a/ShootingStars/src/org/wyrez/shootingstars/gui/FileMetaInfoGUI.java +++ b/ShootingStars/src/org/wyrez/shootingstars/gui/FileMetaInfoGUI.java @@ -94,6 +94,7 @@ public class FileMetaInfoGUI extends BackgroundedGui implements Gui { listener.startLoading(); } }; + btnStartLoading.setTextPadding(screenHelper.calcY(10f)); btnStartLoading.setText("Play"); btnStartLoading.setFontSize(labelFontSize); @@ -103,6 +104,7 @@ public class FileMetaInfoGUI extends BackgroundedGui implements Gui { listener.cancel(); } }; + btnCancel.setTextPadding(screenHelper.calcY(10f)); btnCancel.setText("Cancel"); btnCancel.setFontSize(labelFontSize); diff --git a/ShootingStars/src/org/wyrez/shootingstars/gui/GameGUI.java b/ShootingStars/src/org/wyrez/shootingstars/gui/GameGUI.java index d9e1ab8..a173c7a 100644 --- a/ShootingStars/src/org/wyrez/shootingstars/gui/GameGUI.java +++ b/ShootingStars/src/org/wyrez/shootingstars/gui/GameGUI.java @@ -77,38 +77,41 @@ public class GameGUI extends Panel implements Gui{ float labelFontSize = screenHelper.calcX(20f); btnStart = new ButtonBase(screen, new Vector2f(startPointx, startPointy), - new Vector2f(screenHelper.calcX(200f), screenHelper.calcY(30f))) { + new Vector2f(screenHelper.calcX(200f), screenHelper.calcY(40f))) { @Override public void onButtonMouseLeftUp(MouseButtonEvent evt, boolean toggled) { listener.start(); } - }; + }; + btnStart.setTextPadding(screenHelper.calcY(10f)); btnStart.setText("Launch"); - btnStart.setTextAlign(BitmapFont.Align.Center); btnStart.setFontSize(labelFontSize); - + + btnResume = new ButtonBase(screen, new Vector2f(startPointx, startPointYMenu), - new Vector2f(screenHelper.calcX(200f), screenHelper.calcY(30f))) { + new Vector2f(screenHelper.calcX(200f), screenHelper.calcY(40f))) { @Override public void onButtonMouseLeftUp(MouseButtonEvent evt, boolean toggled) { listener.resume(); } - }; + }; + btnResume.setTextPadding(screenHelper.calcY(10f)); btnResume.setText("Resume"); - btnResume.setTextAlign(BitmapFont.Align.Center); btnResume.setFontSize(labelFontSize); - - btnMenu = new ButtonBase(screen, new Vector2f(startPointx, startPointYMenu + screenHelper.calcY(40f)), - new Vector2f(screenHelper.calcX(200f), screenHelper.calcY(30f))) { + + + btnMenu = new ButtonBase(screen, new Vector2f(startPointx, startPointYMenu + screenHelper.calcY(50f)), + new Vector2f(screenHelper.calcX(200f), screenHelper.calcY(40f))) { @Override public void onButtonMouseLeftUp(MouseButtonEvent evt, boolean toggled) { listener.cancelTrack(); } - }; + }; + btnMenu.setTextPadding(screenHelper.calcY(10f)); btnMenu.setText("Menu"); - btnMenu.setTextAlign(BitmapFont.Align.Center); btnMenu.setFontSize(labelFontSize); - + + indOverheat = new Indicator(screen, new Vector2f(0f, 0f), Indicator.Orientation.VERTICAL) { @Override public void onChange(float arg0, float arg1) { diff --git a/ShootingStars/src/org/wyrez/shootingstars/gui/HighscoreGUI.java b/ShootingStars/src/org/wyrez/shootingstars/gui/HighscoreGUI.java index b48b430..719d334 100644 --- a/ShootingStars/src/org/wyrez/shootingstars/gui/HighscoreGUI.java +++ b/ShootingStars/src/org/wyrez/shootingstars/gui/HighscoreGUI.java @@ -105,6 +105,7 @@ public class HighscoreGUI extends BackgroundedGui implements Gui { listener.back(); } }; + btnBack.setTextPadding(screenHelper.calcY(10f)); btnBack.setText("Back"); btnBack.setFontSize(buttonFontSize); @@ -117,6 +118,7 @@ public class HighscoreGUI extends BackgroundedGui implements Gui { drawHighscores(scores); } }; + btnFilter.setTextPadding(screenHelper.calcY(10f)); btnFilter.setText("Filter Song Name"); btnFilter.setFontSize(buttonFontSize); diff --git a/ShootingStars/src/org/wyrez/shootingstars/gui/LoadingGui.java b/ShootingStars/src/org/wyrez/shootingstars/gui/LoadingGui.java index 9141e9e..281f606 100644 --- a/ShootingStars/src/org/wyrez/shootingstars/gui/LoadingGui.java +++ b/ShootingStars/src/org/wyrez/shootingstars/gui/LoadingGui.java @@ -55,7 +55,6 @@ 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.setIndicatorImage("Gui/Indicator/indicator_ol_x.png"); indProgress.setDisplayValues(); indProgress.setMaxValue(LoadingProgress.getProgressCount()); indProgress.setIndicatorColor(ColorRGBA.Black); diff --git a/ShootingStars/src/org/wyrez/shootingstars/gui/MenuGUI.java b/ShootingStars/src/org/wyrez/shootingstars/gui/MenuGUI.java index 775e297..0bcd612 100644 --- a/ShootingStars/src/org/wyrez/shootingstars/gui/MenuGUI.java +++ b/ShootingStars/src/org/wyrez/shootingstars/gui/MenuGUI.java @@ -70,6 +70,7 @@ public class MenuGUI extends BackgroundedGui implements Gui { listener.selectFile(); } }; + btnStart.setTextPadding(screenHelper.calcY(10f)); btnStart.setText("Start Game"); btnStart.setFontSize(buttonFontSize); @@ -79,6 +80,7 @@ public class MenuGUI extends BackgroundedGui implements Gui { listener.openhighscore(); } }; + btnHighscore.setTextPadding(screenHelper.calcY(10f)); btnHighscore.setText("Highscore"); btnHighscore.setFontSize(buttonFontSize); @@ -88,6 +90,7 @@ public class MenuGUI extends BackgroundedGui implements Gui { listener.openOptions(); } }; + btnOptions.setTextPadding(screenHelper.calcY(10f)); btnOptions.setText("Options"); btnOptions.setFontSize(buttonFontSize); @@ -97,6 +100,7 @@ public class MenuGUI extends BackgroundedGui implements Gui { listener.exitGame(); } }; + btnExit.setTextPadding(screenHelper.calcY(10f)); btnExit.setText("Exit Game"); btnExit.setFontSize(buttonFontSize); diff --git a/ShootingStars/src/org/wyrez/shootingstars/gui/OptionsGUI.java b/ShootingStars/src/org/wyrez/shootingstars/gui/OptionsGUI.java index 7d701c3..ee2f158 100644 --- a/ShootingStars/src/org/wyrez/shootingstars/gui/OptionsGUI.java +++ b/ShootingStars/src/org/wyrez/shootingstars/gui/OptionsGUI.java @@ -98,6 +98,7 @@ public class OptionsGUI extends BackgroundedGui implements Gui { listener.save(); } }; + btnSave.setTextPadding(screenHelper.calcY(10f)); btnSave.setText("Save"); btnSave.setFontSize(labelFontSize); @@ -107,6 +108,7 @@ public class OptionsGUI extends BackgroundedGui implements Gui { listener.cancel(); } }; + btnCancel.setTextPadding(screenHelper.calcY(10f)); btnCancel.setText("Cancel"); btnCancel.setFontSize(labelFontSize); diff --git a/ShootingStars/src/org/wyrez/shootingstars/gui/SelectTrackGUI.java b/ShootingStars/src/org/wyrez/shootingstars/gui/SelectTrackGUI.java index 1072139..f38dc92 100644 --- a/ShootingStars/src/org/wyrez/shootingstars/gui/SelectTrackGUI.java +++ b/ShootingStars/src/org/wyrez/shootingstars/gui/SelectTrackGUI.java @@ -64,6 +64,7 @@ public class SelectTrackGUI extends BackgroundedGui implements Gui { listener.selectFile(); } }; + btnSelectFile.setTextPadding(screenHelper.calcY(10f)); btnSelectFile.setText("Select File"); btnSelectFile.setFontSize(buttonFontSize); @@ -77,6 +78,7 @@ public class SelectTrackGUI extends BackgroundedGui implements Gui { listener.downloadYT(); } }; + btnYTDownload.setTextPadding(screenHelper.calcY(10f)); btnYTDownload.setText("YT Download"); btnYTDownload.setFontSize(buttonFontSize); @@ -86,6 +88,7 @@ public class SelectTrackGUI extends BackgroundedGui implements Gui { listener.cancel(); } }; + btnCancel.setTextPadding(screenHelper.calcY(10f)); btnCancel.setText("Cancel"); btnCancel.setFontSize(buttonFontSize); diff --git a/ShootingStars/src/org/wyrez/shootingstars/gui/YTDownloadGUI.java b/ShootingStars/src/org/wyrez/shootingstars/gui/YTDownloadGUI.java index ec2c81c..ca68470 100644 --- a/ShootingStars/src/org/wyrez/shootingstars/gui/YTDownloadGUI.java +++ b/ShootingStars/src/org/wyrez/shootingstars/gui/YTDownloadGUI.java @@ -79,6 +79,7 @@ public class YTDownloadGUI extends BackgroundedGui implements Gui { listener.downloadYTVideo(txtYTLink.getText()); } }; + btnYTDownload.setTextPadding(screenHelper.calcY(10f)); btnYTDownload.setText("Download"); btnYTDownload.setFontSize(buttonFontSize); @@ -88,6 +89,7 @@ public class YTDownloadGUI extends BackgroundedGui implements Gui { listener.cancel(); } }; + btnCancel.setTextPadding(screenHelper.calcY(10f)); btnCancel.setText("Cancel"); btnCancel.setFontSize(buttonFontSize);