changed default album cover texture, minor clean up

This commit is contained in:
Harrison Deng 2017-05-07 00:47:09 -05:00
parent c17b5c490a
commit 2adaa11762
14 changed files with 26 additions and 15 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

BIN
android/assets/defaultCover.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -134,7 +134,7 @@ public class Polyjet extends Game {
defaultSkin.add("sub-font", default_fontGenerator.generateFont(new FreeTypeFontParameter() {
{
size = fontScale(0.05f);
size = fontScale(0.047f);
}
}));
@ -238,4 +238,9 @@ public class Polyjet extends Game {
Gdx.app.debug("Font pixel size", MathUtils.round(Gdx.graphics.getDensity()*(fontSize*Gdx.graphics.getHeight())) + "px");
return MathUtils.round(Gdx.graphics.getDensity()*(fontSize*Gdx.graphics.getHeight()));
}
public int fontSizeWDensity(float fontSize) {
return MathUtils.round(Gdx.graphics.getDensity()*(fontSize));
}
}

View File

@ -48,10 +48,6 @@ public class PreGameScreen extends ScreenAdapter implements TransitionAdapter {
@Override
public void postTransition() {
stage.clear();
//draw music selector
MusicSelectionPage musicSelection = new MusicSelectionPage(core, mainMenu);
stage.addActor(musicSelection);
musicSelection.beginMusicSearch();
statusText = new Label(null, core.defaultSkin);
statusText.setPosition(1.6f*Gdx.graphics.getWidth(), (Gdx.graphics.getHeight()-statusText.getHeight())/2);
@ -63,6 +59,11 @@ public class PreGameScreen extends ScreenAdapter implements TransitionAdapter {
cyberCircle1.setPosition(Gdx.graphics.getWidth()-cyberCircle1.getWidth()/2-10, -cyberCircle1.getHeight()*2/4f);
stage.addActor(cyberCircle1);
//draw music selector
MusicSelectionPage musicSelection = new MusicSelectionPage(core, mainMenu);
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);

View File

@ -100,6 +100,8 @@ public class MusicSelectable extends Button implements Disposable {
if (author == null || author.isEmpty()) {
author = "N/A";
}
defaults().pad(10f);
}
@ -108,7 +110,7 @@ public class MusicSelectable extends Button implements Disposable {
defaults().align(Align.top);
add(displayName).expandX().fillX().padTop(10f).top().padBottom(10f);
add(displayName).expandX().pad(0).fillX().padTop(10f).top().padBottom(10f);
row();
String formattedTime = "Run time: "+ String.valueOf(durationInSeconds/60) + ":";
@ -120,19 +122,19 @@ public class MusicSelectable extends Button implements Disposable {
formattedTime = formattedTime.concat(String.valueOf(durationInSeconds - (durationInSeconds/60)*60));
runTime = new Label(formattedTime, skin, "sub-font", skin.getColor("default"));
songInfoTable.add(runTime).center();
songInfoTable.add(runTime).expandX().left();
songInfoTable.row();
authorLabel = new Label("Author: " + author, skin, "sub-font", skin.getColor("default"));
songInfoTable.add(authorLabel).expandY();
songInfoTable.add(authorLabel).left();
songInfoTable.row();
previousTopLabel = new Label("High Score: " + (previousTop != -1 ? previousTop : "N/A"), skin, "sub-font", skin.getColor("default"));
songInfoTable.add(previousTopLabel).center();
songInfoTable.add(previousTopLabel).left();
songInfoTable.row();
ratedDifficultyLabel = new Label("Difficulty: " + (ratedDifficulty != -1 ? ratedDifficulty : "N/A"), skin, "sub-font", skin.getColor("default"));
songInfoTable.add(ratedDifficultyLabel).expandY();
songInfoTable.add(ratedDifficultyLabel).left();
songInfoTable.row();
row();
@ -147,12 +149,13 @@ public class MusicSelectable extends Button implements Disposable {
albumArt.dispose();
} else {
imageIcon = new Image(albumCover);
if (invalidMusic) {
imageIcon.setColor(Color.RED);
}
Gdx.app.debug("UI", "album cover invalid or null for image: " + songName);
}
add(imageIcon).prefSize(256f).expandY().center();
if (invalidMusic) {
imageIcon.setColor(Color.RED);
}
add(imageIcon).expandY().center().pad(15f).size(256f);
}
public int getPreviousTop() {

View File

@ -61,6 +61,8 @@ public class MusicSelectionPage extends Page {
musicChoiceScroller = new ScrollPane(musicChoices);
musicChoiceScroller.setScrollingDisabled(false, true);
musicChoiceScroller.setSize(getWidth(), getHeight()*0.85f);
musicChoiceScroller.debug();
addActor(musicChoiceScroller);
}
@ -92,7 +94,7 @@ public class MusicSelectionPage extends Page {
@Override
public void run() {
Gdx.app.debug("Music Search Thread", "Finished loading: " + selectable.getName());
musicChoices.add(selectable).prefSize(256, 0.8f*getHeight());
musicChoices.add(selectable).prefSize(400f, 0.8f*getHeight());
selectable.addInfoToPanel(musicChoiceScroller);
}
});