aesthetic rework

This commit is contained in:
Harrison Deng 2017-11-27 18:37:10 -06:00
parent b81656d187
commit 07cc783624
4 changed files with 36 additions and 24 deletions

View File

@ -22,7 +22,7 @@ check-on
index: -1 index: -1
check-disabled check-disabled
rotate: false rotate: false
xy: 192, 20 xy: 68, 14
size: 14, 14 size: 14, 14
split: 3, 3, 3, 3 split: 3, 3, 3, 3
orig: 14, 14 orig: 14, 14
@ -340,26 +340,26 @@ loading
index: -1 index: -1
holo-pane holo-pane
rotate: false rotate: false
xy: 68, 8 xy: 105, 17
size: 20, 20 size: 8, 8
split: 9, 9, 9, 9 split: 2, 2, 2, 2
orig: 20, 20 orig: 8, 8
offset: 0, 0 offset: 0, 0
index: -1 index: -1
holo-pane-down holo-pane-down
rotate: false rotate: false
xy: 133, 8 xy: 133, 8
size: 20, 20 size: 20, 20
split: 9, 9, 9, 9 split: 4, 4, 4, 4
orig: 20, 20 orig: 20, 20
offset: 0, 0 offset: 0, 0
index: -1 index: -1
large-pane corner-panel
rotate: false rotate: false
xy: 182, 5 xy: 182, 1
size: 9, 27 size: 32, 32
split: 4, 4, 13, 13 split: 15, 15, 15, 15
orig: 9, 27 orig: 32, 32
offset: 0, 0 offset: 0, 0
index: -1 index: -1
rect rect
@ -389,8 +389,8 @@ rect-disabled
side-bars side-bars
rotate: false rotate: false
xy: 221, 35 xy: 221, 35
size: 5, 14 size: 15, 14
split: 2, 2, 0, 0 split: 7, 7, 2, 2
orig: 5, 14 orig: 5, 14
offset: 0, 0 offset: 0, 0
index: -1 index: -1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -106,7 +106,7 @@ public class ScrollText extends Widget {
clipBounds.setSize(getWidth()-2, getHeight()*1.5f); clipBounds.setSize(getWidth()-2, getHeight()*1.5f);
if (text1Width + text2Width > clipBounds.getWidth()) { if (text1Width + text2Width > clipBounds.getWidth()) {
if (scrollOnHover) { if (scrollOnHover) {
if (scroll || text1Offset < 0 || text1Offset > 5) { if (scroll || text1Offset < 0 || text1Offset > 2) {
scroll(delta); scroll(delta);
} }
} else { } else {

View File

@ -23,6 +23,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton; import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.ui.VerticalGroup;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable; import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Array;
@ -44,6 +45,7 @@ public class MusicSelectionPage extends Page implements Observer {
private TextButton back; private TextButton back;
private Table musicInfoTable; private Table musicInfoTable;
private Table musicSubInfo;
private ScrollText songTitle; private ScrollText songTitle;
private Label author; private Label author;
private Label songLength; private Label songLength;
@ -58,6 +60,8 @@ public class MusicSelectionPage extends Page implements Observer {
private boolean down, up; private boolean down, up;
private int musicSelectableIndex; private int musicSelectableIndex;
private TextButton beginButton;
private float scrollTimer, scrollDelay = 0.2f, scrollDelMod, songSelectionTimer; private float scrollTimer, scrollDelay = 0.2f, scrollDelMod, songSelectionTimer;
public MusicSelectionPage(Skin skin, MusicListController musicList, AssetManager assetManager, Vector3 cameraTarget) { public MusicSelectionPage(Skin skin, MusicListController musicList, AssetManager assetManager, Vector3 cameraTarget) {
@ -113,17 +117,19 @@ public class MusicSelectionPage extends Page implements Observer {
}); });
musicInfoTable = new Table(); musicInfoTable = new Table();
musicInfoTable.defaults().center().space(5f); musicInfoTable.defaults().center();
musicInfoTable.setPosition(musicTableScrollPane.getWidth() + musicTableScrollPane.getX(), 0); musicInfoTable.setPosition(musicTableScrollPane.getWidth() + musicTableScrollPane.getX(), 0);
musicInfoTable.setSize(getWidth()-musicTableScrollPane.getWidth(), getHeight()); musicInfoTable.setSize(getWidth()-musicTableScrollPane.getWidth(), getHeight());
addActor(musicInfoTable); addActor(musicInfoTable);
musicSubInfo = new Table(skin);
musicSubInfo.setBackground("corner-panel");
songTitle = new ScrollText("", null, skin, true, true); songTitle = new ScrollText("", null, skin, true, true);
author = new Label(null, skin, "sub-font", skin.getColor("default")); author = new Label(null, skin, "sub-font", skin.getColor("default"));
songLength = new Label(null, skin, "sub-font", skin.getColor("default")); songLength = new Label(null, skin, "sub-font", skin.getColor("default"));
previousTop = new Label(null, skin, "sub-font", skin.getColor("default")); previousTop = new Label(null, skin, "sub-font", skin.getColor("default"));
ratedDifficulty = new Label(null, skin, "sub-font", skin.getColor("default")); ratedDifficulty = new Label(null, skin, "sub-font", skin.getColor("default"));
albumCover = new Image(assetManager.get("defaultCover.png", Texture.class)); albumCover = new Image(assetManager.get("defaultCover.png", Texture.class));
beginButton = new TextButton("Begin", skin);
} }
@Override @Override
@ -174,6 +180,7 @@ public class MusicSelectionPage extends Page implements Observer {
musicTable.clear(); musicTable.clear();
selectables.clear(); selectables.clear();
musicInfoTable.clear(); musicInfoTable.clear();
musicSubInfo.clear();
for (int i = 0; i < selectables.size; i++) { for (int i = 0; i < selectables.size; i++) {
selectables.get(i).dispose(); selectables.get(i).dispose();
@ -200,17 +207,22 @@ public class MusicSelectionPage extends Page implements Observer {
} }
extraInfoDone = true; extraInfoDone = true;
musicInfoTable.add(songTitle).width(musicInfoTable.getWidth()*0.7f).spaceBottom(10f); musicInfoTable.add(songTitle).width(musicInfoTable.getWidth()*0.7f).spaceBottom(30f);
musicInfoTable.row(); musicInfoTable.row();
musicInfoTable.add(author); musicSubInfo.add(author);
musicInfoTable.row(); musicSubInfo.row();
musicInfoTable.add(songLength); musicSubInfo.add(songLength);
musicInfoTable.row(); musicSubInfo.row();
musicInfoTable.add(previousTop); musicSubInfo.add(previousTop);
musicInfoTable.row(); musicSubInfo.row();
musicInfoTable.add(ratedDifficulty); musicSubInfo.add(ratedDifficulty);
musicSubInfo.pack();
musicInfoTable.add(musicSubInfo).spaceBottom(20f);
musicInfoTable.row(); musicInfoTable.row();
musicInfoTable.add(albumCover).size(musicInfoTable.getWidth()/2f); musicInfoTable.add(albumCover).size(musicInfoTable.getWidth()/2f);
musicInfoTable.row();
musicInfoTable.add(beginButton).spaceTop(20f).fillX();
if (currentlySelected != null) { if (currentlySelected != null) {
updateInformation(); updateInformation();
} }