summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/src/com/ilotterytea/maxoning/inputprocessors/CrossProcessor.java62
-rw-r--r--core/src/com/ilotterytea/maxoning/screens/GameScreen.java3
-rw-r--r--core/src/com/ilotterytea/maxoning/screens/MenuScreen.java5
-rw-r--r--core/src/com/ilotterytea/maxoning/screens/SplashScreen.java7
-rw-r--r--desktop/src/com/ilotterytea/maxoning/DesktopLauncher.java2
5 files changed, 69 insertions, 10 deletions
diff --git a/core/src/com/ilotterytea/maxoning/inputprocessors/CrossProcessor.java b/core/src/com/ilotterytea/maxoning/inputprocessors/CrossProcessor.java
new file mode 100644
index 0000000..7f9fab6
--- /dev/null
+++ b/core/src/com/ilotterytea/maxoning/inputprocessors/CrossProcessor.java
@@ -0,0 +1,62 @@
+package com.ilotterytea.maxoning.inputprocessors;
+
+import com.badlogic.gdx.Gdx;
+import com.badlogic.gdx.Input;
+import com.badlogic.gdx.InputProcessor;
+import com.ilotterytea.maxoning.utils.ScreenshotFactory;
+
+public class CrossProcessor implements InputProcessor {
+ @Override
+ public boolean keyDown(int keycode) {
+ // Take a screenshot:
+ if (Gdx.input.isKeyPressed(Input.Keys.F2)) {
+ ScreenshotFactory.takeScreenshot();
+ return true;
+ }
+ // Toggle the fullscreen:
+ if (Gdx.input.isKeyPressed(Input.Keys.F11)) {
+ if (Gdx.graphics.isFullscreen()) {
+ Gdx.graphics.setWindowedMode(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
+ } else {
+ Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode());
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean keyUp(int keycode) {
+ return false;
+ }
+
+ @Override
+ public boolean keyTyped(char character) {
+ return false;
+ }
+
+ @Override
+ public boolean touchDown(int screenX, int screenY, int pointer, int button) {
+ return false;
+ }
+
+ @Override
+ public boolean touchUp(int screenX, int screenY, int pointer, int button) {
+ return false;
+ }
+
+ @Override
+ public boolean touchDragged(int screenX, int screenY, int pointer) {
+ return false;
+ }
+
+ @Override
+ public boolean mouseMoved(int screenX, int screenY) {
+ return false;
+ }
+
+ @Override
+ public boolean scrolled(float amountX, float amountY) {
+ return false;
+ }
+}
diff --git a/core/src/com/ilotterytea/maxoning/screens/GameScreen.java b/core/src/com/ilotterytea/maxoning/screens/GameScreen.java
index 8b21597..b9970b0 100644
--- a/core/src/com/ilotterytea/maxoning/screens/GameScreen.java
+++ b/core/src/com/ilotterytea/maxoning/screens/GameScreen.java
@@ -16,6 +16,7 @@ import com.badlogic.gdx.utils.Timer;
import com.badlogic.gdx.utils.viewport.FillViewport;
import com.ilotterytea.maxoning.MaxonGame;
import com.ilotterytea.maxoning.anim.SpriteUtils;
+import com.ilotterytea.maxoning.inputprocessors.CrossProcessor;
import com.ilotterytea.maxoning.player.MaxonItem;
import com.ilotterytea.maxoning.player.MaxonItemRegister;
import com.ilotterytea.maxoning.player.MaxonPlayer;
@@ -220,7 +221,7 @@ public class GameScreen implements Screen, InputProcessor {
//stage.addActor(pointsBar);
stage.addActor(pointsLabel);
stage.addActor(infoLabel);
- Gdx.input.setInputProcessor(new InputMultiplexer(this, stage));
+ Gdx.input.setInputProcessor(new InputMultiplexer(this, new CrossProcessor(), stage));
}
@Override
diff --git a/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java b/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java
index 105afed..2f85558 100644
--- a/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java
+++ b/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java
@@ -14,6 +14,7 @@ import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.utils.Align;
import com.badlogic.gdx.utils.viewport.FillViewport;
import com.ilotterytea.maxoning.MaxonGame;
+import com.ilotterytea.maxoning.inputprocessors.CrossProcessor;
import com.ilotterytea.maxoning.ui.DebugLabel;
import java.io.IOException;
@@ -121,7 +122,7 @@ public class MenuScreen implements Screen, InputProcessor {
menuTable.addAction(Actions.sequence(Actions.alpha(0f), Actions.moveTo(0f, -Gdx.graphics.getHeight() - Gdx.graphics.getHeight(), 0f)));
- Gdx.input.setInputProcessor(new InputMultiplexer(this, stage));
+ Gdx.input.setInputProcessor(new InputMultiplexer(this, new CrossProcessor(), stage));
}
@Override public void show() {
@@ -187,8 +188,6 @@ public class MenuScreen implements Screen, InputProcessor {
menuMusic.play();
}
- private final float wallVelocity = 1f;
-
@Override
public void render(float delta) {
Gdx.gl.glClearColor(0, 0, 0, 1f);
diff --git a/core/src/com/ilotterytea/maxoning/screens/SplashScreen.java b/core/src/com/ilotterytea/maxoning/screens/SplashScreen.java
index b9138a7..bc3c472 100644
--- a/core/src/com/ilotterytea/maxoning/screens/SplashScreen.java
+++ b/core/src/com/ilotterytea/maxoning/screens/SplashScreen.java
@@ -10,10 +10,9 @@ import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.utils.viewport.FillViewport;
-import com.ilotterytea.maxoning.MaxonConstants;
import com.ilotterytea.maxoning.MaxonGame;
+import com.ilotterytea.maxoning.inputprocessors.CrossProcessor;
import com.ilotterytea.maxoning.ui.DebugLabel;
-import com.ilotterytea.maxoning.utils.AssetLoading;
public class SplashScreen implements InputProcessor, Screen {
@@ -109,7 +108,7 @@ public class SplashScreen implements InputProcessor, Screen {
stage.addActor(org);
stage.addActor(disclaimer);
- Gdx.input.setInputProcessor(new InputMultiplexer(this, stage));
+ Gdx.input.setInputProcessor(new InputMultiplexer(this, new CrossProcessor(), stage));
}
@Override public void show() {
@@ -118,8 +117,6 @@ public class SplashScreen implements InputProcessor, Screen {
render(Gdx.graphics.getDeltaTime());
}
- private final float wallVelocity = 1f;
-
@Override
public void render(float delta) {
Gdx.gl.glClearColor(0, 0, 0, 1);
diff --git a/desktop/src/com/ilotterytea/maxoning/DesktopLauncher.java b/desktop/src/com/ilotterytea/maxoning/DesktopLauncher.java
index 5ee733f..207454d 100644
--- a/desktop/src/com/ilotterytea/maxoning/DesktopLauncher.java
+++ b/desktop/src/com/ilotterytea/maxoning/DesktopLauncher.java
@@ -15,7 +15,7 @@ public class DesktopLauncher {
config.setForegroundFPS(60);
config.setTitle("Maxon Petting Simulator");
config.setWindowIcon("icon.png");
- config.setFullscreenMode(Lwjgl3ApplicationConfiguration.getDisplayMode());
+ config.setMaximized(true);
new Lwjgl3Application(new MaxonGame(), config);
}