resize main page widget position changed

This commit is contained in:
Harrison Deng 2018-01-15 18:36:23 -06:00
parent 7ca69899b3
commit bdbb6f7fd4
3 changed files with 6 additions and 3 deletions

View File

@ -97,6 +97,7 @@ public class RhythmBullet extends Game {
queueAssets();
setScreen(initialScreen);
screenWidth = Gdx.graphics.getWidth();
screenHeight = Gdx.graphics.getHeight();
}
@ -160,7 +161,10 @@ public class RhythmBullet extends Game {
@Override
public void resize(int width, int height) {
Gdx.app.debug("RhythmBullet/resize", "Previous size:" + screenWidth + "x" + screenHeight + " new size: " + width + "x" + height);
if (width != screenWidth || height != screenHeight) {
screenWidth = Gdx.graphics.getWidth();
screenHeight = Gdx.graphics.getHeight();
if (initComplete) {
Gdx.app.debug("Resize", "Pre-transition is happening. Using resolution " + width + "x" + height);
rRHandler.setResolution(width, height);

View File

@ -199,7 +199,6 @@ public class Visualizer extends Widget implements Disposable {
updateVisualizerProperties();
vis.updatePositionInfo();
vis.setxPos(((vis.getWidth() - vis.getActualWidth())/2f));
Gdx.app.debug("Visualizer", "currently offseting visualizer by (px): " + vis.getxPos());
vis.updatePositionInfo();
}

View File

@ -86,12 +86,12 @@ public class MainPage extends Page implements Observer {
table.add(quitButton).fillX();
musicControls = new MusicControls(core.getDefaultSkin(), mlc);
musicControls.setPosition((getWidth()-musicControls.getMinWidth() - 20f), getHeight()-musicControls.getMinHeight()-15f);
musicControls.setPosition((getWidth()-musicControls.getMinWidth() - 20f), getHeight()-musicControls.getMinHeight()-20f);
addActor(musicControls);
scrollText = new ScrollText("...", "...", core.getDefaultSkin(), false, true);
scrollText.setWidth(0.5f*getWidth());
scrollText.setPosition(15, getHeight() - scrollText.getHeight()-15f);
scrollText.setPosition(15, getHeight() - scrollText.getHeight()-25f);
addActor(scrollText);
if (mlc.getMusicList().isSearched() && mlc.getCurrentMusicManager() != null) {