placement adjustement
This commit is contained in:
parent
160f87b801
commit
879921e5aa
@ -95,7 +95,7 @@ public class ScrollText extends Widget {
|
|||||||
if (getHeight() < (textHeight+4)) {
|
if (getHeight() < (textHeight+4)) {
|
||||||
setHeight(textHeight + 4);
|
setHeight(textHeight + 4);
|
||||||
}
|
}
|
||||||
clipBounds.setSize(getWidth()-1, getHeight()*1.5f);
|
clipBounds.setSize(getWidth()-2, getHeight()*1.5f);
|
||||||
super.layout();
|
super.layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,8 +149,8 @@ public class ScrollText extends Widget {
|
|||||||
|
|
||||||
batch.flush();
|
batch.flush();
|
||||||
if (ScissorStack.pushScissors(scissors)) {
|
if (ScissorStack.pushScissors(scissors)) {
|
||||||
font.draw(batch, text1, coords.x + text1Offset, coords.y + getFontHeight() + getHeight()/4f);
|
font.draw(batch, text1, coords.x + text1Offset, coords.y + getFontHeight() + 4);
|
||||||
font.draw(batch, text2, coords.x + text2Offset, coords.y + getFontHeight() + getHeight()/4f);
|
font.draw(batch, text2, coords.x + text2Offset, coords.y + getFontHeight() + 4);
|
||||||
batch.flush();
|
batch.flush();
|
||||||
ScissorStack.popScissors();
|
ScissorStack.popScissors();
|
||||||
};
|
};
|
||||||
|
@ -68,7 +68,7 @@ public class TitleBarVisualizer extends Group implements Disposable {
|
|||||||
if (titleImage.getWidth() > 0.8f*getWidth()) {
|
if (titleImage.getWidth() > 0.8f*getWidth()) {
|
||||||
titleImage.setScale((bg.getWidth()-(0.2f*Gdx.graphics.getWidth()))/titleImage.getWidth());
|
titleImage.setScale((bg.getWidth()-(0.2f*Gdx.graphics.getWidth()))/titleImage.getWidth());
|
||||||
}
|
}
|
||||||
titleImage.setPosition((getWidth() - titleImage.getWidth())/2f, (getHeight() - titleImage.getHeight())/2f -10);
|
titleImage.setPosition((getWidth() - titleImage.getWidth()*titleImage.getScaleX())/2f, (getHeight() - titleImage.getHeight()*titleImage.getScaleY())/2f -5);
|
||||||
titleImage.setColor(Color.WHITE);
|
titleImage.setColor(Color.WHITE);
|
||||||
addActor(titleImage);
|
addActor(titleImage);
|
||||||
|
|
||||||
|
@ -86,9 +86,16 @@ public class MainPage extends Page implements OnDifferentSongListener {
|
|||||||
addActor(musicControls);
|
addActor(musicControls);
|
||||||
|
|
||||||
scrollText = new ScrollText("...", "...", core.getDefaultSkin(), false, true);
|
scrollText = new ScrollText("...", "...", core.getDefaultSkin(), false, true);
|
||||||
scrollText.setWidth(0.5f*getWidth());
|
scrollText.setWidth((0.4f * getWidth()));
|
||||||
scrollText.setHeight(musicControls.getMinHeight());
|
scrollText.setHeight(musicControls.getMinHeight());
|
||||||
scrollText.setPosition((getWidth() - scrollText.getWidth())/2f, musicControls.getY() - 22f);
|
scrollText.setPosition(((getWidth() - scrollText.getWidth())/2f), getHeight() - scrollText.getFontHeight()*1.5f);
|
||||||
|
if (scrollText.getX() + scrollText.getWidth() > musicControls.getX()) {
|
||||||
|
Gdx.app.debug("MainPage", "using minimal layout for scrolling text.");
|
||||||
|
musicControls.setX(getWidth() - musicControls.getMinWidth() - 5f);
|
||||||
|
scrollText.setPosition(15, getHeight() - scrollText.getHeight() - 15f);
|
||||||
|
musicControls.setY(scrollText.getY() + 22f);
|
||||||
|
musicControls.invalidate();
|
||||||
|
}
|
||||||
scrollText.invalidate();
|
scrollText.invalidate();
|
||||||
addActor(scrollText);
|
addActor(scrollText);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user