diff --git a/core/src/cz/nic/tablexia/TablexiaSettings.java b/core/src/cz/nic/tablexia/TablexiaSettings.java index a7f2a7f4f09fcf6db464c22e0dede686a4a79ae2..3e0ac8a2421fbaf913081e436dead36915533f2c 100644 --- a/core/src/cz/nic/tablexia/TablexiaSettings.java +++ b/core/src/cz/nic/tablexia/TablexiaSettings.java @@ -24,8 +24,8 @@ public class TablexiaSettings { private static final int MIN_SCREEN_HEIGHT = (int) (DEFAULT_SCREEN_WIDTH * MAXIMUM_RATIO); private static final boolean DEBUG_SHOW_BOUNDING_BOXES = true; - public static final Class<? extends AbstractTablexiaScreen<?>> INITIAL_SCREEN = FormScreen.class; - public static final int AVATAR_COUNT = 8; + public static final Class<? extends AbstractTablexiaScreen<?>> INITIAL_SCREEN = FormScreen.class; + public static final int AVATAR_COUNT = 8; private static final String PREFERENCES_KEY = "cz.nic.tablexia."; public static final String LOCALE_KEY = "locale"; diff --git a/core/src/cz/nic/tablexia/screen/createuser/FormScreen.java b/core/src/cz/nic/tablexia/screen/createuser/FormScreen.java index 9d60786fb3c8265bac58b87f84c453594d7bc905..44f16a1d236ec5d1601b809e538dc5a5e1efe10d 100644 --- a/core/src/cz/nic/tablexia/screen/createuser/FormScreen.java +++ b/core/src/cz/nic/tablexia/screen/createuser/FormScreen.java @@ -55,11 +55,11 @@ public class FormScreen extends AbstractAutoloadTablexiaScreen<Void> { Group group = new Group(); Image background = new Image(getTexture("table")); - ScaleUtil.setFullScreen(background, getStage()); + ScaleUtil.setBackgroundSize(background); group.addActor(background); group.addActor(ScaleUtil.createImageWidthPosition(getTexture("inkpad"), getStage().getWidth() * 0.3f, getStage().getWidth() * -0.1f, getStage().getWidth() * 0.3f)); - group.addActor(ScaleUtil.createImageSizePosition(getTexture("background"), getStage().getWidth() * 0.75f, TablexiaSettings.getMinScreenHeight() * 0.98f, getStage().getWidth() * 0.13f, 0)); + group.addActor(ScaleUtil.createImageSizePosition(getTexture("background"), getStage().getWidth() * 0.75f, TablexiaSettings.getMinWorldHeight() * 0.98f, getStage().getWidth() * 0.13f, 0)); group.addActor(ScaleUtil.createImageWidthPosition(getTexture("badge"), getStage().getWidth() * 0.3f, getStage().getWidth() * 0.18f, getStage().getWidth() * 0.15f)); group.addActor(mugshotImage = ScaleUtil.createImageWidthPosition(getTexture("avatar/0"), getStage().getWidth() * 0.13f, getStage().getWidth() * 0.6f, getStage().getWidth() * 0.34f)); // size for all mugshots group.addActor(mugshotFrame = ScaleUtil.createImageWidthPosition(getTexture("mugshotframe"), getStage().getWidth() * 0.17f, getStage().getWidth() * 0.58f, getStage().getWidth() * 0.32f)); @@ -179,7 +179,7 @@ public class FormScreen extends AbstractAutoloadTablexiaScreen<Void> { // grey translucent overlay Image overlay = new Image(getTexture("avatar/overlay")); overlay.getColor().a = 0.5f; - mugshots.addActor(ScaleUtil.setFullScreen(overlay, getStage())); + mugshots.addActor(ScaleUtil.setBackgroundSize(overlay)); overlay.addListener(new InputListener() { @Override public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { @@ -271,7 +271,7 @@ public class FormScreen extends AbstractAutoloadTablexiaScreen<Void> { // grey translucent overlay Image overlay = new Image(getTexture("avatar/overlay")); overlay.getColor().a = 0.5f; - signature.addActor(ScaleUtil.setFullScreen(overlay, getStage())); + signature.addActor(ScaleUtil.setBackgroundSize(overlay)); overlay.addListener(new InputListener() { @Override public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { diff --git a/core/src/cz/nic/tablexia/screen/loader/LoaderScreen.java b/core/src/cz/nic/tablexia/screen/loader/LoaderScreen.java index 9227fa552ce19cca89b28ae87e551b7bcff18f4f..72b1cbfce05aee4930abfb758ca609327bb51967 100644 --- a/core/src/cz/nic/tablexia/screen/loader/LoaderScreen.java +++ b/core/src/cz/nic/tablexia/screen/loader/LoaderScreen.java @@ -6,6 +6,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Image; import java.util.List; +import cz.nic.tablexia.TablexiaSettings; import cz.nic.tablexia.loader.TablexiaAssetManager; import cz.nic.tablexia.screen.AbstractLinearTextureTablexiaScreen; @@ -28,23 +29,24 @@ public class LoaderScreen extends AbstractLinearTextureTablexiaScreen<Void> { @Override protected void screenLoaded() { + // TODO fix screen size Image background = new Image(getTexture(LOADER_BACKGROUND)); background.setPosition(0, 0); - background.setSize(getStage().getWidth(), getStage().getHeight()); + background.setSize(getStage().getWidth(), TablexiaSettings.getMinWorldHeight()); getStage().addActor(background); Image smallhand = new Image(getTexture(LOADER_SMALL_HAND)); - smallhand.setPosition(getStage().getWidth() * 0.22f, getStage().getHeight() * 0.64f); - smallhand.setSize(getStage().getWidth() * 0.01f, getStage().getHeight() * 0.06f); + smallhand.setPosition(220, 355); + smallhand.setSize(10, 40); getStage().addActor(smallhand); - smallhand.setOrigin(smallhand.getWidth() / 2, 0); + smallhand.setOrigin(smallhand.getWidth() / 2, 5); smallhand.addAction(Actions.forever(Actions.rotateBy(-360, 6))); Image bighand = new Image(getTexture(LOADER_BIG_HAND)); - bighand.setPosition(getStage().getWidth() * 0.22f, getStage().getHeight() * 0.64f); - bighand.setSize(getStage().getWidth() * 0.01f, getStage().getHeight() * 0.06f); + bighand.setPosition(220, 355); + bighand.setSize(10, 40); getStage().addActor(bighand); - bighand.setOrigin(bighand.getWidth() / 2, 0); + bighand.setOrigin(bighand.getWidth() / 2, 5); bighand.addAction(Actions.forever(Actions.rotateBy(-360, 0.5f))); } diff --git a/core/src/cz/nic/tablexia/util/ScaleUtil.java b/core/src/cz/nic/tablexia/util/ScaleUtil.java index de2d78cf6aedd41d13db7fe908482331c625b9cf..4dc65214df95ee1999f63af6b0b404a484c92c5f 100644 --- a/core/src/cz/nic/tablexia/util/ScaleUtil.java +++ b/core/src/cz/nic/tablexia/util/ScaleUtil.java @@ -5,6 +5,8 @@ import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.ui.Image; +import cz.nic.tablexia.TablexiaSettings; + /** * Created by lhoracek on 4/7/15. */ @@ -70,8 +72,14 @@ public class ScaleUtil { return actor; } + public static Actor setBackgroundSize(Actor actor) { + setPosition(actor, 0, -TablexiaSettings.getMinWorldHeight()/2); + actor.setSize(TablexiaSettings.getWorldWidth(), TablexiaSettings.getMinWorldHeight()*2); + return actor; + } + public static Actor setPosition(Actor actor, float x, float y) { - actor.setPosition(0, 0); + actor.setPosition(x, y); return actor; } }