mainpage ui improved
This commit is contained in:
parent
a1278eed9b
commit
8d8ef15ce4
@ -90,9 +90,6 @@ public class MusicControls extends HorizontalGroup {
|
||||
space(15);
|
||||
|
||||
invalidate();
|
||||
|
||||
debugAll();
|
||||
debug();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -94,13 +94,15 @@ public class ScrollText extends Widget {
|
||||
clipBounds.setSize(getWidth()-2, getHeight()*1.5f);
|
||||
|
||||
text2Offset = clipBounds.getWidth();
|
||||
if (text1Width < clipBounds.getWidth()) {
|
||||
text1Offset = (clipBounds.getWidth()-text1Width)/2f;
|
||||
}
|
||||
super.layout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void act(float delta) {
|
||||
validate();
|
||||
setSize(getMinWidth(), textHeight + 4);
|
||||
setSize(getWidth(), textHeight + 4);
|
||||
clipBounds.setSize(getWidth()-2, getHeight()*1.5f);
|
||||
if (text1Width + text2Width > clipBounds.getWidth()) {
|
||||
if (scrollOnHover) {
|
||||
@ -171,10 +173,7 @@ public class ScrollText extends Widget {
|
||||
gLayout = new GlyphLayout(font, text1);
|
||||
text1Width = gLayout.width;
|
||||
textHeight = gLayout.height;
|
||||
text2Offset = clipBounds.getWidth();
|
||||
if (text1Width < clipBounds.getWidth()) {
|
||||
text1Offset = (clipBounds.getWidth()-text1Width)/2f;
|
||||
}
|
||||
|
||||
if (text2 != null) {
|
||||
this.text2 = text2;
|
||||
gLayout = new GlyphLayout(font, text2);
|
||||
@ -183,5 +182,7 @@ public class ScrollText extends Widget {
|
||||
this.text2 = text1;
|
||||
this.text2Width = text1Width;
|
||||
}
|
||||
|
||||
layout();
|
||||
}
|
||||
}
|
||||
|
@ -85,15 +85,12 @@ public class MainPage extends Page implements Observer {
|
||||
|
||||
musicControls = new MusicControls(core.getDefaultSkin(), sc);
|
||||
musicControls.setPosition((getWidth()-musicControls.getMinWidth() - 20f), getHeight()-musicControls.getMinHeight()-15f);
|
||||
musicControls.invalidate();
|
||||
addActor(musicControls);
|
||||
|
||||
scrollText = new ScrollText("...", "...", core.getDefaultSkin(), false, true);
|
||||
scrollText.setWidth(Gdx.graphics.getWidth() - musicControls.getWidth() - 30f);
|
||||
scrollText.setPosition(musicControls.getX() - scrollText.getWidth() - 20f, Gdx.graphics.getHeight() - 15f);
|
||||
scrollText.invalidate();
|
||||
scrollText.setWidth(0.5f*getWidth());
|
||||
scrollText.setPosition(15, getHeight() - scrollText.getHeight()-15f);
|
||||
addActor(scrollText);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user