本文整理汇总了Java中com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java LwjglApplicationConfiguration类的具体用法?Java LwjglApplicationConfiguration怎么用?Java LwjglApplicationConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LwjglApplicationConfiguration类属于com.badlogic.gdx.backends.lwjgl包,在下文中一共展示了LwjglApplicationConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; //导入依赖的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.LwjglApplicationConfiguration; //导入依赖的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.LwjglApplicationConfiguration; //导入依赖的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.LwjglApplicationConfiguration; //导入依赖的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.LwjglApplicationConfiguration; //导入依赖的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.LwjglApplicationConfiguration; //导入依赖的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: setupDisplay
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; //导入依赖的package包/类
private static void setupDisplay(LwjglApplicationConfiguration config) {
DisplayConfig displayConfig = Configs.loadRequireWithFallback("mod/display.json", "config/display.json",
DisplayConfig.class);
config.title = displayConfig.title;
config.width = displayConfig.windowBounds.width;
config.height = displayConfig.windowBounds.height;
config.fullscreen = displayConfig.fullscreen;
config.vSyncEnabled = displayConfig.vsync;
config.backgroundFPS = displayConfig.backgroundFps;
config.foregroundFPS = displayConfig.foregroundFps;
// prepend current version to title
ProjectConfig projectConfig = Configs.loadRequire("config/project.json", ProjectConfig.class);
config.title = "[" + projectConfig.version + "] " + config.title;
}
示例8: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; //导入依赖的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);
}
示例9: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; //导入依赖的package包/类
public static void main(String[] args)
{
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
new LwjglApplication(new Game(){
@Override
public void create() {
// play a pd patch
Pd.audio.create(new PdConfiguration());
Pd.audio.open(Gdx.files.local("resources/test.pd"));
// and sounds at the same time
final Sound snd = Gdx.audio.newSound(Gdx.files.classpath("shotgun.wav"));
snd.play();
Gdx.input.setInputProcessor(new InputAdapter(){
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
snd.play();
return true;
}
});
}}, config);
}
示例10: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; //导入依赖的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);
}
示例11: AudioManager
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; //导入依赖的package包/类
public AudioManager(Undertailor undertailor) {
if (!AudioManager.audioReplaced) {
log.info("Manager will now try to replace the audio system.");
if (!LwjglApplicationConfiguration.disableAudio) {
try {
((com.badlogic.gdx.backends.lwjgl.audio.OpenALAudio) Gdx.audio).dispose();
LwjglApplicationConfiguration config =
undertailor.getApplicationConfiguration();
Gdx.audio = new OpenALAudio(config.audioDeviceSimultaneousSources,
config.audioDeviceBufferCount, config.audioDeviceBufferSize);
AudioManager.audioReplaced = true;
log.info("Success.");
} catch (Throwable t) {
log.error("Failed.", t);
}
}
}
this.masterVolume = new BoundedFloat(0.0F, 1.0F, 1.0F);
this.musicVolume = new BoundedFloat(0.0F, 1.0F, 1.0F);
this.soundVolume = new BoundedFloat(0.0F, 1.0F, 1.0F);
this.sounds = new ObjectMap<>();
this.music = new ObjectMap<>();
}
示例12: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; //导入依赖的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);
}
示例13: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; //导入依赖的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();
}
示例14: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; //导入依赖的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);
}
示例15: main
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; //导入依赖的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);
}