mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
@@ -164,6 +164,9 @@ public class Forge implements ApplicationListener {
|
|||||||
frameRate = new FrameRate();
|
frameRate = new FrameRate();
|
||||||
animationBatch = new SpriteBatch();
|
animationBatch = new SpriteBatch();
|
||||||
inputProcessor = new MainInputProcessor();
|
inputProcessor = new MainInputProcessor();
|
||||||
|
//screenWidth and screenHeight should be set initially and only change upon restarting the app
|
||||||
|
screenWidth = Gdx.app.getGraphics().getWidth();
|
||||||
|
screenHeight = Gdx.app.getGraphics().getHeight();
|
||||||
|
|
||||||
Gdx.input.setInputProcessor(inputProcessor);
|
Gdx.input.setInputProcessor(inputProcessor);
|
||||||
/*
|
/*
|
||||||
@@ -958,15 +961,15 @@ public class Forge implements ApplicationListener {
|
|||||||
@Override
|
@Override
|
||||||
public void resize(int width, int height) {
|
public void resize(int width, int height) {
|
||||||
try {
|
try {
|
||||||
screenWidth = width;
|
|
||||||
screenHeight = height;
|
|
||||||
if (currentScreen != null) {
|
if (currentScreen != null) {
|
||||||
currentScreen.setSize(width, height);
|
currentScreen.setSize(width, height);
|
||||||
} else if (splashScreen != null) {
|
} else if (splashScreen != null) {
|
||||||
splashScreen.setSize(width, height);
|
splashScreen.setSize(width, height);
|
||||||
}
|
}
|
||||||
|
if (currentScene != null)
|
||||||
|
currentScene.resize(width, height);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
graphics.end();
|
//graphics.end();
|
||||||
//check if sentry is enabled, if not it will call the gui interface but here we end the graphics so we only send it via sentry..
|
//check if sentry is enabled, if not it will call the gui interface but here we end the graphics so we only send it via sentry..
|
||||||
if (BugReporter.isSentryEnabled())
|
if (BugReporter.isSentryEnabled())
|
||||||
BugReporter.reportException(ex);
|
BugReporter.reportException(ex);
|
||||||
|
|||||||
@@ -93,6 +93,9 @@ public abstract class Scene implements Disposable {
|
|||||||
public void updateInput() {
|
public void updateInput() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public void resize(int width, int height) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -192,7 +192,6 @@ public class UIScene extends Scene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public UIScene(String uiFilePath) {
|
public UIScene(String uiFilePath) {
|
||||||
|
|
||||||
uiFile = uiFilePath;
|
uiFile = uiFilePath;
|
||||||
stage = new Stage(new ScalingViewport(Scaling.stretch, getIntendedWidth(), getIntendedHeight())) {
|
stage = new Stage(new ScalingViewport(Scaling.stretch, getIntendedWidth(), getIntendedHeight())) {
|
||||||
@Override
|
@Override
|
||||||
@@ -711,4 +710,9 @@ public class UIScene extends Scene {
|
|||||||
super.updateInput();
|
super.updateInput();
|
||||||
Gdx.input.setInputProcessor(stage);
|
Gdx.input.setInputProcessor(stage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void resize(int width, int height) {
|
||||||
|
stage.getViewport().update(width, height, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user