This repository has been archived on 2025-03-13. You can view files and clone it, but cannot push or open issues or pull requests.

33 lines
1.4 KiB
Java
Raw Normal View History

2024-07-15 18:58:45 +02:00
package com.openeggbert.gwt;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.backends.gwt.GwtApplication;
import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration;
2024-08-16 16:27:02 +02:00
import com.openeggbert.core.configuration.ScreenResolution;
import com.openeggbert.core.main.OpenEggbertApplication;
import com.pixelgamelibrary.api.Pixel;
import com.pixelgamelibrary.backend.libgdx.PixelBackendLibGDX;
import com.pixelgamelibrary.backend.libgdx.game.LibGdxGame;
2024-07-15 18:58:45 +02:00
/** Launches the GWT application. */
public class GwtLauncher extends GwtApplication {
@Override
public GwtApplicationConfiguration getConfig () {
// Resizable application, uses available space in browser with no padding:
GwtApplicationConfiguration cfg = new GwtApplicationConfiguration(true);
cfg.padVertical = 0;
cfg.padHorizontal = 0;
2024-08-06 23:11:17 +02:00
//return cfg;
2024-07-15 18:58:45 +02:00
// If you want a fixed size application, comment out the above resizable section,
// and uncomment below:
2024-08-16 15:46:20 +02:00
return new GwtApplicationConfiguration(ScreenResolution.VGA.getWidth(), ScreenResolution.VGA.getHeight());
2024-07-15 18:58:45 +02:00
}
@Override
public ApplicationListener createApplicationListener () {
if(!Pixel.isBackendSet()) {Pixel.initBackend(new PixelBackendLibGDX());}
return new LibGdxGame(new OpenEggbertApplication().createGame());
2024-07-15 18:58:45 +02:00
}
}