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;
|
2024-08-16 15:46:20 +02:00
|
|
|
import com.openeggbert.core.main.OpenEggbertGame;
|
2024-09-11 21:24:37 +02:00
|
|
|
import com.badlogic.gdx.ai.GdxLogger;
|
2024-09-15 19:40:20 +02:00
|
|
|
import com.openeggbert.core.main.OpenEggbertApplication;
|
2024-09-13 17:14:50 +02:00
|
|
|
import com.pixelgamelibrary.api.Pixel;
|
|
|
|
import com.pixelgamelibrary.backend.libgdx.PixelBackendLibGDX;
|
2024-09-15 19:40:20 +02:00
|
|
|
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-09-13 17:14:50 +02:00
|
|
|
Pixel.initBackend(new PixelBackendLibGDX());
|
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 () {
|
2024-09-15 19:40:20 +02:00
|
|
|
return new LibGdxGame(new OpenEggbertApplication().createGame());
|
2024-07-15 18:58:45 +02:00
|
|
|
}
|
|
|
|
}
|