diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2018-06-26 02:06:32 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2018-06-26 02:06:32 +0200 |
commit | ccbec710375ddab05e60d893851e57f7ee743d19 (patch) | |
tree | d22eb9f39093e4a15113b4f29ff7eaf8f4562cfb /html/src/ch/asynk/zproject/client/HtmlLauncher.java | |
download | gdx-boardgame-ccbec710375ddab05e60d893851e57f7ee743d19.zip gdx-boardgame-ccbec710375ddab05e60d893851e57f7ee743d19.tar.gz |
bare bone libgdx project
generated with https://libgdx.badlogicgames.com/nightlies/dist/gdx-setup.jar
Diffstat (limited to 'html/src/ch/asynk/zproject/client/HtmlLauncher.java')
-rw-r--r-- | html/src/ch/asynk/zproject/client/HtmlLauncher.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/html/src/ch/asynk/zproject/client/HtmlLauncher.java b/html/src/ch/asynk/zproject/client/HtmlLauncher.java new file mode 100644 index 0000000..5890e0c --- /dev/null +++ b/html/src/ch/asynk/zproject/client/HtmlLauncher.java @@ -0,0 +1,51 @@ +package ch.asynk.zproject.client;
+
+import com.badlogic.gdx.ApplicationListener;
+import com.badlogic.gdx.backends.gwt.GwtApplication;
+import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration;
+import ch.asynk.zproject.ZProject;
+
+public class HtmlLauncher extends GwtApplication {
+
+ // USE THIS CODE FOR A FIXED SIZE APPLICATION
+ @Override
+ public GwtApplicationConfiguration getConfig () {
+ return new GwtApplicationConfiguration(480, 320);
+ }
+ // END CODE FOR FIXED SIZE APPLICATION
+
+ // UNCOMMENT THIS CODE FOR A RESIZABLE APPLICATION
+ // PADDING is to avoid scrolling in iframes, set to 20 if you have problems
+ // private static final int PADDING = 0;
+ // private GwtApplicationConfiguration cfg;
+ //
+ // @Override
+ // public GwtApplicationConfiguration getConfig() {
+ // int w = Window.getClientWidth() - PADDING;
+ // int h = Window.getClientHeight() - PADDING;
+ // cfg = new GwtApplicationConfiguration(w, h);
+ // Window.enableScrolling(false);
+ // Window.setMargin("0");
+ // Window.addResizeHandler(new ResizeListener());
+ // cfg.preferFlash = false;
+ // return cfg;
+ // }
+ //
+ // class ResizeListener implements ResizeHandler {
+ // @Override
+ // public void onResize(ResizeEvent event) {
+ // int width = event.getWidth() - PADDING;
+ // int height = event.getHeight() - PADDING;
+ // getRootPanel().setWidth("" + width + "px");
+ // getRootPanel().setHeight("" + height + "px");
+ // getApplicationListener().resize(width, height);
+ // Gdx.graphics.setWindowedMode(width, height);
+ // }
+ // }
+ // END OF CODE FOR RESIZABLE APPLICATION
+
+ @Override
+ public ApplicationListener createApplicationListener () {
+ return new ZProject();
+ }
+}
\ No newline at end of file |