From e698b9bc699c38b9f77a19820a480ef333962fbc Mon Sep 17 00:00:00 2001 From: Recrown Date: Mon, 15 May 2017 00:38:37 -0500 Subject: [PATCH] worked on analysis page --- core/src/zero1hd/polyjet/screens/PreGameScreen.java | 11 ++++++----- core/src/zero1hd/polyjet/ui/pages/AnalyzePage.java | 10 ++++++++-- .../zero1hd/polyjet/ui/pages/MusicSelectionPage.java | 2 +- core/src/zero1hd/polyjet/ui/pages/Page.java | 4 ++++ 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/core/src/zero1hd/polyjet/screens/PreGameScreen.java b/core/src/zero1hd/polyjet/screens/PreGameScreen.java index 5d4267d..516649b 100755 --- a/core/src/zero1hd/polyjet/screens/PreGameScreen.java +++ b/core/src/zero1hd/polyjet/screens/PreGameScreen.java @@ -59,6 +59,12 @@ public class PreGameScreen extends ScreenAdapter implements TransitionAdapter { cyberCircle1.setPosition(Gdx.graphics.getWidth()-cyberCircle1.getWidth()/2-10, -cyberCircle1.getHeight()*2/4f); stage.addActor(cyberCircle1); + Image cyberCircle2 = new Image(core.assetManager.get("cybercircle1.png", Texture.class)); + cyberCircle2.setPosition(1.5f*Gdx.graphics.getWidth()-cyberCircle2.getWidth()/2+20, (Gdx.graphics.getHeight()-cyberCircle2.getHeight())/2); + cyberCircle2.setColor(0.8f,0.8f,0.8f,0.7f); + cyberCircle2.addAction(Actions.alpha(0.7f)); + stage.addActor(cyberCircle2); + analyzePage = new AnalyzePage(core.defaultSkin, cameraTarget); analyzePage.setPosition(1f*Gdx.graphics.getWidth(), 0); stage.addActor(analyzePage); @@ -68,11 +74,6 @@ public class PreGameScreen extends ScreenAdapter implements TransitionAdapter { stage.addActor(musicSelection); musicSelection.beginMusicSearch(); - Image cyberCircle2 = new Image(core.assetManager.get("cybercircle1.png", Texture.class)); - cyberCircle2.setPosition(1.5f*Gdx.graphics.getWidth()-cyberCircle2.getWidth()/2+20, (Gdx.graphics.getHeight()-cyberCircle2.getHeight())/2); - cyberCircle2.setColor(0.8f,0.8f,0.8f,0.7f); - cyberCircle2.addAction(Actions.alpha(0.7f)); - stage.addActor(cyberCircle2); } @Override diff --git a/core/src/zero1hd/polyjet/ui/pages/AnalyzePage.java b/core/src/zero1hd/polyjet/ui/pages/AnalyzePage.java index e61d092..d887979 100755 --- a/core/src/zero1hd/polyjet/ui/pages/AnalyzePage.java +++ b/core/src/zero1hd/polyjet/ui/pages/AnalyzePage.java @@ -33,8 +33,9 @@ public class AnalyzePage extends Page { songInfo = new Table(skin); songInfo.debug(); + back = new TextButton("Back", skin); - back.setPosition(getWidth()-back.getWidth()-15f, getHeight()-back.getHeight()-15f); + back.setPosition(getWidth()-back.getWidth()-15f, getHeightBelowTitle()); back.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { @@ -42,14 +43,19 @@ public class AnalyzePage extends Page { cameraPos.x = 0.5f*getWidth(); } }); + songInfo.setSize(getWidth(), getHeightBelowTitle()); + + addActor(back); } public void setSong(AudioData music, AudioInfo audioInfo) { + songInfo.clear(); + cameraPos.x = 1.5f*getWidth(); this.music = music; audioAnalyzer.startAnalyticalThread(music); - songInfo.add(new Label(audioInfo.getSongName(), skin, "sub-font", skin.getColor("default"))); + songInfo.add(new Label(audioInfo.getSongName(), skin)); addActor(songInfo); } diff --git a/core/src/zero1hd/polyjet/ui/pages/MusicSelectionPage.java b/core/src/zero1hd/polyjet/ui/pages/MusicSelectionPage.java index 4e2aed1..0cf74f5 100755 --- a/core/src/zero1hd/polyjet/ui/pages/MusicSelectionPage.java +++ b/core/src/zero1hd/polyjet/ui/pages/MusicSelectionPage.java @@ -42,7 +42,7 @@ public class MusicSelectionPage extends Page { this.ap = analyzePage; back = new TextButton("Back", core.defaultSkin); - back.setPosition(getWidth()-back.getWidth()-15f, getHeight()-back.getHeight()-15f); + back.setPosition(getWidth()-back.getWidth()-15f, getHeightBelowTitle()); back.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { diff --git a/core/src/zero1hd/polyjet/ui/pages/Page.java b/core/src/zero1hd/polyjet/ui/pages/Page.java index d191bee..6d87dad 100755 --- a/core/src/zero1hd/polyjet/ui/pages/Page.java +++ b/core/src/zero1hd/polyjet/ui/pages/Page.java @@ -21,4 +21,8 @@ public class Page extends Group { pageTitle.setPosition(18f, getHeight()-pageTitle.getHeight()-15f); addActor(pageTitle); } + + public float getHeightBelowTitle() { + return pageTitle.getY(); + } }