prep for next panel of analysis page

This commit is contained in:
Harrison Deng 2017-07-10 16:35:50 -05:00
parent 1f84a68ae5
commit 1573884e99
2 changed files with 21 additions and 11 deletions

View File

@ -1,6 +1,5 @@
package zero1hd.polyjet.ui.builders; package zero1hd.polyjet.ui.builders;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.BitmapFont;
@ -139,7 +138,6 @@ public class ScrollText extends Widget {
coords.x = getX(); coords.x = getX();
coords.y = getY(); coords.y = getY();
// localToStageCoordinates(coords);
clipBounds.setX(coords.x); clipBounds.setX(coords.x);
clipBounds.setY(coords.y - 0.5f*getHeight()); clipBounds.setY(coords.y - 0.5f*getHeight());

View File

@ -26,21 +26,30 @@ public class AnalyzePage extends Page implements MiniListener {
AudioAnalyzer audioAnalyzer; AudioAnalyzer audioAnalyzer;
AudioData music; AudioData music;
Table songInfo; Table difficultyTable;
Slider difficultyModifier; private Label diffTitle;
Label difficultyModifierPercentage; private Slider sensitivityRating;
private Label sensitivityRatingTitle;
private Slider speedModifier;
private Label speedModifierTitle;
private Slider healthModifier;
private Label healthModifierTitle;
private Skin skin; private Skin skin;
private TextButton back; private TextButton back;
private Image loadingCircle; private Image loadingCircle;
private long startTime, endTime; private long startTime, endTime;
private ScrollText songName;
Table songInfo;
private Label[] info; private Label[] info;
public AnalyzePage(Skin skin, AssetManager assets) { public AnalyzePage(Skin skin, AssetManager assets) {
super("Results", skin); super("Results", skin);
this.skin = skin; this.skin = skin;
difficultyTable = new Table(skin);
//TODO work on sliders and stuff
songInfo = new Table(skin); songInfo = new Table(skin);
songInfo.setSize(getWidth()/2f, getHeightBelowTitle()/2f);
songInfo.setBackground(skin.getDrawable("large-pane")); songInfo.setBackground(skin.getDrawable("large-pane"));
loadingCircle = new Image(assets.get("cybercircle1.png", Texture.class)); loadingCircle = new Image(assets.get("cybercircle1.png", Texture.class));
@ -71,16 +80,16 @@ public class AnalyzePage extends Page implements MiniListener {
public void setSong(AudioData music, AudioInfo audioInfo, MiniListener listener) { public void setSong(AudioData music, AudioInfo audioInfo, MiniListener listener) {
songInfo.clear(); songInfo.clear();
songInfo.align(Align.top);
songInfo.pad(15f); songInfo.pad(15f);
songInfo.defaults().align(Align.left); songInfo.defaults().align(Align.left | Align.top);
audioAnalyzer = new AudioAnalyzer(); audioAnalyzer = new AudioAnalyzer();
audioAnalyzer.sender.addListener(this); audioAnalyzer.sender.addListener(this);
this.music = music; this.music = music;
songName = new ScrollText(audioInfo.getSongName(), skin, true);
audioAnalyzer.startAnalyticalThread(music); audioAnalyzer.startAnalyticalThread(music);
songInfo.add(songName).expandX().fillX(); songInfo.add(new ScrollText(audioInfo.getSongName(), skin, true)).expandX().fillX().spaceBottom(20f);
for (int i = 0; i < info.length; i++) { for (int i = 0; i < info.length; i++) {
info[i].setColor(1f, 1f, 1f, 0f); info[i].setColor(1f, 1f, 1f, 0f);
@ -89,8 +98,11 @@ public class AnalyzePage extends Page implements MiniListener {
songInfo.add(info[i]); songInfo.add(info[i]);
} }
startTime = System.currentTimeMillis(); songInfo.pack();
songInfo.setWidth(getWidth()/2f);
songInfo.setPosition((getWidth()-songInfo.getWidth())/2f, (getHeightBelowTitle()-songInfo.getHeight())/2f); songInfo.setPosition((getWidth()-songInfo.getWidth())/2f, (getHeightBelowTitle()-songInfo.getHeight())/2f);
startTime = System.currentTimeMillis();
info[0].addAction(Actions.color(Color.BLACK, 2.5f)); info[0].addAction(Actions.color(Color.BLACK, 2.5f));
System.out.println(songInfo); System.out.println(songInfo);
} }