mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Start working on Landscape mode
This commit is contained in:
@@ -217,6 +217,14 @@ public class Forge implements ApplicationListener {
|
||||
});
|
||||
}
|
||||
|
||||
public static int getScreenWidth() {
|
||||
return screenWidth;
|
||||
}
|
||||
|
||||
public static int getScreenHeight() {
|
||||
return screenHeight;
|
||||
}
|
||||
|
||||
public static FScreen getCurrentScreen() {
|
||||
return currentScreen;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class BugReportDialog extends FScreen { //use screen rather than dialog s
|
||||
|
||||
private TemplateView(String text0) {
|
||||
text = text0;
|
||||
setHeight(Forge.getCurrentScreen().getHeight() / 3);
|
||||
setHeight(Forge.getScreenHeight() / 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -175,7 +175,7 @@ public class VStack extends FDropDown {
|
||||
}
|
||||
|
||||
FMenuTab menuTab = getMenuTab();
|
||||
float screenHeight = Forge.getCurrentScreen().getHeight();
|
||||
float screenHeight = Forge.getScreenHeight();
|
||||
float width = (screenHeight - 2 * VPrompt.HEIGHT - 2 * VAvatar.HEIGHT) * 4f / 6f;
|
||||
float maxVisibleHeight = menuTab.screenPos.x;
|
||||
paneSize = updateAndGetPaneSize(width + MatchController.getView().getTopPlayerPanel().getTabs().iterator().next().getRight(), maxVisibleHeight);
|
||||
|
||||
@@ -3,6 +3,7 @@ package forge.toolbox;
|
||||
import com.badlogic.gdx.graphics.g2d.BitmapFont.HAlignment;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
|
||||
import forge.Forge;
|
||||
import forge.Graphics;
|
||||
import forge.animation.ForgeAnimation;
|
||||
import forge.assets.FSkinColor;
|
||||
@@ -27,7 +28,6 @@ public abstract class FDialog extends FOverlay {
|
||||
private static final FSkinColor SWIPE_BAR_COLOR = FScreen.Header.BACK_COLOR;
|
||||
private static final FSkinColor SWIPE_BAR_DOT_COLOR = FSkinColor.get(Colors.CLR_TEXT).alphaColor(0.75f);
|
||||
private static final float SWIPE_BAR_HEIGHT = Utils.scale(12);
|
||||
private static final float BASE_REVEAL_VELOCITY = 3 * Utils.SCREEN_HEIGHT;
|
||||
|
||||
private static int openDialogCount = 0;
|
||||
|
||||
@@ -83,7 +83,7 @@ public abstract class FDialog extends FOverlay {
|
||||
updateDisplayTop();
|
||||
|
||||
if (firstReveal) { //start reveal animation after dialog first laid out
|
||||
updateRevealAnimation(BASE_REVEAL_VELOCITY);
|
||||
updateRevealAnimation(3 * Forge.getScreenHeight());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class FOptionPane extends FDialog {
|
||||
public static final float PADDING = Utils.scale(10);
|
||||
|
||||
public static float getMaxDisplayObjHeight() {
|
||||
return Forge.getCurrentScreen().getHeight() - VPrompt.HEIGHT - 2 * FDialog.MSG_HEIGHT;
|
||||
return Forge.getScreenHeight() - VPrompt.HEIGHT - 2 * FDialog.MSG_HEIGHT;
|
||||
}
|
||||
|
||||
public static void showMessageDialog(final String message) {
|
||||
@@ -127,7 +127,7 @@ public class FOptionPane extends FDialog {
|
||||
CardRenderer.drawCard(g, card, x, y, w, h, CardStackPosition.Top);
|
||||
}
|
||||
};
|
||||
cardDisplay.setHeight(Utils.SCREEN_HEIGHT / 2);
|
||||
cardDisplay.setHeight(Forge.getScreenHeight() / 2);
|
||||
}
|
||||
else {
|
||||
cardDisplay = null;
|
||||
@@ -195,7 +195,7 @@ public class FOptionPane extends FDialog {
|
||||
}) {
|
||||
@Override
|
||||
protected float getBottomMargin() {
|
||||
return Utils.SCREEN_HEIGHT * 0.4f; //account for keyboard
|
||||
return Forge.getScreenHeight() * 0.4f; //account for keyboard
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,17 +5,20 @@ import com.badlogic.gdx.math.Rectangle;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
|
||||
public class Utils {
|
||||
public static final boolean DEV_SCREEN_LANDSCAPE = false;
|
||||
|
||||
public static final float BASE_WIDTH = 320f;
|
||||
public static final float BASE_HEIGHT = 480f;
|
||||
public static final float SCREEN_WIDTH = (float)Gdx.graphics.getWidth();
|
||||
public static final float SCREEN_HEIGHT = (float)Gdx.graphics.getHeight();
|
||||
private static final float SCREEN_WIDTH = (float)Gdx.graphics.getWidth();
|
||||
private static final float SCREEN_HEIGHT = (float)Gdx.graphics.getHeight();
|
||||
private static final float HEIGHT_RATIO = SCREEN_HEIGHT / BASE_HEIGHT;
|
||||
|
||||
private static final float AVG_FINGER_SIZE_CM = 1.1f;
|
||||
|
||||
//Swap commented out line below to specify average finger size and dev screen size
|
||||
private static final float ppcX = Gdx.graphics.getPpcX(), ppcY = Gdx.graphics.getPpcY();
|
||||
public static final int DEV_SCREEN_WIDTH = (int)BASE_WIDTH, DEV_SCREEN_HEIGHT = (int)BASE_HEIGHT;
|
||||
public static final int DEV_SCREEN_WIDTH = DEV_SCREEN_LANDSCAPE ? (int)(BASE_HEIGHT * 16 / 9) : (int)BASE_WIDTH;
|
||||
public static final int DEV_SCREEN_HEIGHT = (int)BASE_HEIGHT;
|
||||
//private static final float ppcX = 169f / AVG_FINGER_SIZE_CM, ppcY = 237f / AVG_FINGER_SIZE_CM;
|
||||
//public static final int DEV_SCREEN_WIDTH = 400, DEV_SCREEN_HEIGHT = 600;
|
||||
//private static final float scaleX = 1.41f, scaleY = 1.25f;
|
||||
|
||||
Reference in New Issue
Block a user