本文整理匯總了Java中com.badlogic.gdx.backends.lwjgl.LwjglApplication類的典型用法代碼示例。如果您正苦於以下問題:Java LwjglApplication類的具體用法?Java LwjglApplication怎麽用?Java LwjglApplication使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
LwjglApplication類屬於com.badlogic.gdx.backends.lwjgl包,在下文中一共展示了LwjglApplication類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; //導入依賴的package包/類
public static void main (String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.width = FlappyChapa.WIDTH;
config.height = FlappyChapa.HEIGHT;
config.title = FlappyChapa.TITLE;
config.addIcon("icons/chapaicon.png", Files.FileType.Internal);
config.addIcon("icons/chapaicon1.png", Files.FileType.Internal);
config.addIcon("icons/chapaicon2.png", Files.FileType.Internal);
new LwjglApplication(new FlappyChapa(), config);
}
示例2: run
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; //導入依賴的package包/類
@Override
protected void run(ApplicationListener applicationListener) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.addIcon("assets/icon-16x.png", Files.FileType.Internal);
config.addIcon("assets/icon-32x.png", Files.FileType.Internal);
config.addIcon("assets/icon-64x.png", Files.FileType.Internal);
config.addIcon("assets/icon-128x.png", Files.FileType.Internal);
config.vSyncEnabled = false;
config.foregroundFPS = 0;
config.backgroundFPS = 0;
config.width = windowWidth;
config.height = windowHeight;
config.forceExit = false;
new LwjglApplication(applicationListener, config);
}
示例3: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; //導入依賴的package包/類
public static void main (String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.width = 1280;
config.height = 720;
config.title = Constants.NAME;
config.backgroundFPS = 30;
if (System.getProperties().getProperty("os.name").toLowerCase().contains("mac")) {
config.addIcon("image/icon-512.png", Files.FileType.Internal);
config.addIcon("image/icon-256.png", Files.FileType.Internal);
}
config.addIcon("image/icon-32.png", Files.FileType.Internal);
config.addIcon("image/icon-16.png", Files.FileType.Internal);
ArgumentParser argParser = new ArgumentParser(arg);
Control[] controls = new Control[argParser.touchControl ? 3 : 2];
controls[0] = new ControlKeyboard();
controls[1] = new ControlController();
if (argParser.touchControl)
controls[2] = new ControlTouch();
new LwjglApplication(new Client(controls, new Audio(), argParser), config);
}
示例4: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; //導入依賴的package包/類
public static void main (String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.title = "Miniventure";
config.width = GameCore.SCREEN_WIDTH;
config.height = GameCore.SCREEN_HEIGHT;
new LwjglApplication(new GameCore(), config);
}
示例5: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; //導入依賴的package包/類
public static void main(String[] arg) {
try {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.resizable = false;
DesktopConfigEditor editor = new DesktopConfigEditor();
Config cfg = DesktopConfigUtil.buildConfig(editor);
DesktopConfigUtil.setupLwjglConfig(config, cfg);
LwjglApplication application = new LwjglApplication(new ArcadeLegendsGame(cfg), config);
//application.postRunnable(() -> application.getGraphics().setUndecorated(true));
DesktopConfigUtil.registerStandardListeners(editor, cfg, config, application);
} catch (Exception ex) {
log.error(MarkerFactory.getMarker("ERROR"), "Error loading config", ex);
System.exit(0);
}
}
示例6: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; //導入依賴的package包/類
public static void main (String[] arg) {
if(!DEPLOYMENT) {
//AutoPacking.size = 4096;
AutoPacking.pack("game", "image", "game");
}
//game
KyperBoxGame game = new ParticleTests();
//config
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.width = (int) game.getView().getWorldWidth();
config.height = (int) game.getView().getWorldHeight();
config.title = game.getGameName();
new LwjglApplication(game, config);
}
示例7: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; //導入依賴的package包/類
public static void main (String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
PMD game = new PMD();
//set these things as these values for now can edit later
//Gdx.graphics.getWidth and height return null because lwgwl app has not been made yet
config.width = 1080;
config.height = 720;
config.vSyncEnabled = false;
config.foregroundFPS = 60;
config.backgroundFPS = 60;
config.title = PMD.TITLE;
//UISimpleTest test = new UISimpleTest();
LwjglApplication app = new LwjglApplication(game, config);
}
示例8: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; //導入依賴的package包/類
public static void main(String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.useGL30 = false;
config.width = 1024;
config.height = 768;
config.fullscreen = false;
config.vSyncEnabled = config.fullscreen;
Gdx.app = new LwjglApplication(new QuillysCastleGame(), config);
Gdx.app.setLogLevel(Application.LOG_DEBUG);
// Gdx.app.setLogLevel(Application.LOG_INFO);
// Gdx.app.setLogLevel(Application.LOG_ERROR);
// Gdx.app.setLogLevel(Application.LOG_NONE);
}
示例9: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; //導入依賴的package包/類
public static void main(String[] args) {
Thread.currentThread().setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread arg0, Throwable arg1) {
System.out.println("Thread " + arg0);
arg1.printStackTrace();
}
});
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.width = UIConfig.TERM_WIDTH * UIConfig.CELL_WIDTH;
config.height = UIConfig.TERM_HEIGHT * UIConfig.CELL_HEIGHT;
config.title = "Anathema";
config.vSyncEnabled = false;
config.foregroundFPS = 0;
config.backgroundFPS = 30;
config.resizable = false;
//config.addIcon(path, fileType);
new LwjglApplication(Game.getInstance(), config);
Game.getInstance().start();
}
示例10: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; //導入依賴的package包/類
public static void main(String[] arg)
{
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
// config.width = 1280;
// config.height = 720;
config.width = 1800;
config.height = 1000;
// config.width = 1920;
// config.height = 1080;
// config.width = 100;
// config.height = 100;
// config.width = 800;
// config.height = 600;
// config.fullscreen = true;
config.fullscreen = false;
config.resizable = false;
new LwjglApplication(new SpaceTravels3(), config);
}
示例11: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; //導入依賴的package包/類
/**
* Entry point.
* --development option forces regenerating atlases
*
* @param args the command line arguments
*/
@SuppressWarnings("unused")
public static void main(String[] args) throws IOException {
Psychobear game = new Psychobear();
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
cfg.vSyncEnabled = true;
cfg.width = 1280;
cfg.height = 720;
cfg.fullscreen = false;
cfg.useGL30 = true;
ShaderProgram.prependVertexCode = "#version 140\n#define varying out\n#define attribute in\n";
ShaderProgram.prependFragmentCode = "#version 140\n#define varying in\n#define texture2D texture\n#define gl_FragColor fragColor\nout vec4 fragColor;\n";
LwjglApplication app = new LwjglApplication(game, cfg);
}
示例12: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; //導入依賴的package包/類
public static void main (String[] arg) {
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
cfg.title = "Inspiration";
cfg.useGL30 = false;
cfg.width = 640;
cfg.height = 480;
// cfg.width = 800;
// cfg.height = 600;
// fullscreen
// cfg.fullscreen = true;
// vSync
// cfg.vSyncEnabled = true;
cfg.addIcon("icon.png", Files.FileType.Internal);
Gdx.app = new LwjglApplication(new Inspiration(), cfg);
//Gdx.app.setLogLevel(Application.LOG_INFO);
Gdx.app.setLogLevel(Application.LOG_DEBUG);
//Gdx.app.setLogLevel(Application.LOG_ERROR);
//Gdx.app.setLogLevel(Application.LOG_NONE);
}
示例13: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; //導入依賴的package包/類
public static void main (String[] arg) {
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
cfg.title = "Inspiration";
cfg.useGL30 = false;
cfg.width = 640;
cfg.height = 480;
// cfg.width = 800;
// cfg.height = 600;
// fullscreen
// cfg.fullscreen = true;
// vSync
// cfg.vSyncEnabled = true;
cfg.addIcon("icon.png", Files.FileType.Internal);
Gdx.app = new LwjglApplication(new Inspiration(), cfg);
//Gdx.app.setLogLevel(Application.LOG_INFO);
// Gdx.app.setLogLevel(Application.LOG_DEBUG);
//Gdx.app.setLogLevel(Application.LOG_ERROR);
//Gdx.app.setLogLevel(Application.LOG_NONE);
}
示例14: start
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; //導入依賴的package包/類
public static void start(Arguments arguments) {
LoggerUtils.setupExternalFileOutput();
final LwjglApplicationConfiguration configuration = new LwjglApplicationConfiguration();
configuration.title = AppConstants.APP_TITLE;
configuration.addIcon("icon128.png", Files.FileType.Classpath);
configuration.addIcon("icon32.png", Files.FileType.Classpath);
configuration.addIcon("icon16.png", Files.FileType.Classpath);
configuration.preferencesDirectory = AppConstants.EXTERNAL_DIR;
configuration.width = 1024;
configuration.height = 600;
configuration.allowSoftwareMode = arguments.softOpenGL;
AppParams appParams = new AppParams();
appParams.startupProject = arguments.project;
App app = new App(new DesktopClassScanner(), appParams);
new LwjglApplication(new WindowParamsPersistingApplicationWrapper(app, configuration), configuration);
}
示例15: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; //導入依賴的package包/類
public static void main(String[] args)
{
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
new LwjglApplication(new Game(){
@Override
public void create() {
// play a music
Music music = Gdx.audio.newMusic(Gdx.files.classpath("cloudconnected.ogg"));
music.setVolume(0.3f);
music.play();
// and a pd patch at the same time
Pd.audio.create(new PdConfiguration());
Pd.audio.open(Gdx.files.local("resources/test.pd"));
}}, config);
}