Jave main desktop launcher

19 Jave code examples are found related to " main desktop launcher". You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.
Example 1
Source File: DesktopLauncher.java    From gdx-gltf with Apache License 2.0 6 votes vote down vote up
public static void main (String[] arg) {
	
	// required for HTTPS requests
	System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2");
	
	LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
	config.width = 1024;
	config.height = 768;
	
	GLTFDemo.AUTOLOAD_ENTRY = arg.length > 1 ? arg[1] : "BoomBox";
	GLTFDemo.AUTOLOAD_VARIANT = arg.length > 2 ? arg[2] : "glTF-Binary";
	GLTFDemo.alternateMaps = arg.length > 3 ? arg[3] : null;
	
	GLTFDemoUI.fileSelector = new AWTFileSelector();
	
	new LwjglApplication(arg.length > 0 ? new GLTFDemo(arg[0]) : new GLTFDemo(), config);
}
 
Example 2
Source File: DesktopLauncher.java    From FruitCatcher with Apache License 2.0 6 votes vote down vote up
public static void main (String[] arg) {
       // Create two run configurations
       // 1. For texture packing. Pass 'texturepacker' as argument and use desktop/src
       //    as working directory
       // 2. For playing game with android/assets as working directory
       if (arg.length == 1 && arg[0].equals("texturepacker")) {
           String outdir = "assets";
           TexturePacker.Settings settings = new TexturePacker.Settings();
           settings.maxWidth = 1024;
           settings.maxHeight = 1024;
           TexturePacker.process(settings, "images", outdir, "game");
           TexturePacker.process(settings, "text-images", outdir, "text_images");
           TexturePacker.process(settings, "text-images-de", outdir, "text_images_de");
       }
       else {
           LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
           config.title = "FruitCatcher";
           config.width = 800;
           config.height = 480;
           new LwjglApplication(new FruitCatcherGame(null, "en"), config);
       }
}
 
Example 3
Source File: DesktopLauncher.java    From gdx-proto with Apache License 2.0 6 votes vote down vote up
public static void main (String[] args) {
	cfg = new LwjglApplicationConfiguration();
	cfg.title = "FPS";
	cfg.resizable = true;
	//cfg.samples = 8; // anti-aliasing
	cfg.width = 1280;
	cfg.height = 720;
	cfg.fullscreen = false;
	cfg.r = 8;
	cfg.g = 8;
	cfg.b = 8;
	cfg.a = 8;
	CommandArgs.ScreenSize screenSize = CommandArgs.process(args);
	if (screenSize != null) {
		cfg.width = screenSize.width;
		cfg.height = screenSize.height;
	}
	new LwjglApplication(new Main(), cfg);
}
 
Example 4
Source File: DesktopLauncher.java    From Norii with Apache License 2.0 5 votes vote down vote up
public static void main(final String[] arg) {
	final LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
	config.title = "Norii a turn based strategy game by Jelte";
	config.width = 580;
	config.height = 580;
	config.fullscreen = false;
	config.initialBackgroundColor = Color.BLACK;

	final Application app = new LwjglApplication(new Norii(), config);
	Gdx.app = app;
	Gdx.app.setLogLevel(Application.LOG_DEBUG);
}
 
Example 5
Source File: DesktopLauncher.java    From xibalba with MIT License 5 votes vote down vote up
/**
 * Start desktop launcher.
 *
 * @param arg Arguments
 */
public static void main(String[] arg) {
  LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();

  config.title = "Xibalba";
  config.width = 960;
  config.height = 540;

  config.vSyncEnabled = false;
  config.foregroundFPS = 0;
  config.backgroundFPS = 0;

  new LwjglApplication(new Main(), config);
}
 
Example 6
Source File: DesktopLauncher.java    From gdx-soundboard with MIT License 5 votes vote down vote up
public static void main (String[] arg) {
	LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
       config.width = 800;
       config.height = 480;
       config.title = "UsageExample";
	new LwjglApplication(new UsageExample(), config);
}
 
Example 7
Source File: DesktopLauncher.java    From Klooni1010 with GNU General Public License v3.0 5 votes vote down vote up
public static void main(String[] arg) {
    LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
    config.title = "Klooni 1010!";
    config.width = Klooni.GAME_WIDTH;
    config.height = Klooni.GAME_HEIGHT;
    config.addIcon("ic_launcher/icon128.png", Files.FileType.Internal);
    config.addIcon("ic_launcher/icon32.png", Files.FileType.Internal);
    config.addIcon("ic_launcher/icon16.png", Files.FileType.Internal);
    new LwjglApplication(new Klooni(null), config);
}
 
Example 8
Source File: DesktopLauncher.java    From libgdx-demo-pax-britannica with MIT License 5 votes vote down vote up
public static void main(String[] args) {
	LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
	config.width = 1024;
	config.height = 550;
	config.title = "Pax Britannica";
	new LwjglApplication(new PaxBritannica(), config);
}
 
Example 9
Source File: DesktopLauncher.java    From ashley-superjumper with Apache License 2.0 5 votes vote down vote up
public static void main (String[] arg) {
	LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
	config.title = "Super Jumper";
	config.width = 480;
	config.height = 800;
	new LwjglApplication(new SuperJumper(), config);
}
 
Example 10
Source File: DesktopLauncher.java    From androidsvgdrawable-plugin with Apache License 2.0 5 votes vote down vote up
public static void main (String[] arg) {
	LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
	config.width = 1024;
	config.height = 512;
	config.title = "AndroidSvgDrawable LibGDX Sample";
	new LwjglApplication(new CardDeckApplication(), config);
}
 
Example 11
Source File: DesktopLauncher.java    From Unlucky with MIT License 5 votes vote down vote up
public static void main(String[] args) {
    LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
    config.width = Unlucky.V_WIDTH * Unlucky.V_SCALE;
    config.height = Unlucky.V_HEIGHT * Unlucky.V_SCALE;
    config.title = Unlucky.TITLE;
    config.resizable = false;
    config.vSyncEnabled = false;
    config.backgroundFPS = 10;
    config.foregroundFPS = 60;
    config.addIcon("desktop_icon128.png", Files.FileType.Internal);
    config.addIcon("desktop_icon32.png", Files.FileType.Internal);
    config.addIcon("desktop_icon16.png", Files.FileType.Internal);
    new LwjglApplication(new Unlucky(), config);
}
 
Example 12
Source File: DesktopLauncher.java    From killingspree with MIT License 5 votes vote down vote up
public static void main (String[] arg) {
		LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
		config.title = "Killing Spree";
		config.height = 720;
		config.width = 1280;
		config.vSyncEnabled = true;
//		config.fullscreen = true;
		new LwjglApplication(new KillingSpree(new DesktopServices()), config);
	}
 
Example 13
Source File: DesktopLauncher.java    From GdxDemo3D with Apache License 2.0 4 votes vote down vote up
public static void main(String[] arg) {
	LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
	new LwjglApplication(new GdxDemo3D(), config);
}
 
Example 14
Source File: DesktopLauncher.java    From libgdx-artemis-quickstart with MIT License 4 votes vote down vote up
public static void main (String[] arg) {
	LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
	new LwjglApplication(new GdxArtemisGame(), config);
}
 
Example 15
Source File: DesktopLauncher.java    From Bomberman_libGdx with MIT License 4 votes vote down vote up
public static void main (String[] arg) {
	LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
               config.width = 640;
               config.height = 480;
	new LwjglApplication(new Bomberman(), config);
}
 
Example 16
Source File: DesktopLauncher.java    From gdx-vr with Apache License 2.0 4 votes vote down vote up
public static void main(String[] arg) {
	LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
	config.title = "GDX-VR";
	new LwjglApplication(new SimpleRoom(), config);
	new OculusImplementation();
}
 
Example 17
Source File: DesktopLauncher.java    From AzurLaneSpineCharacterDecoder with MIT License 4 votes vote down vote up
public static void main (String[] args) {
	LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
	config.resizable=true;

	new LwjglApplication(new AzurLaneSpineCharacterDecoder(args), config);
}
 
Example 18
Source File: DesktopLauncher.java    From SIFTrain with MIT License 4 votes vote down vote up
public static void main (String[] arg) {
	LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
	GlobalConfiguration.appVersionName = "debug build.";
	new LwjglApplication(new SifTrain(), "SIF Train", 1280, 720);
}
 
Example 19
Source File: Main.java    From swingsane with Apache License 2.0 4 votes vote down vote up
private static void createDesktopLauncher() {
  try {
    String jarPath = Main.class.getProtectionDomain().getCodeSource().getLocation().toURI()
        .getPath();
    File jarFile = new File(jarPath);
    if (!(jarFile.exists())) {
      return;
    }
    String path = jarFile.getParentFile().getCanonicalPath();
    File launcherFile = new File(path + File.separator + "SwingSane.desktop");
    if (launcherFile.exists()) {
      return;
    }
    File iconFile = new File(path + File.separator + "swingsane_512x512.png");
    InputStream iconStream = Main.class
        .getResourceAsStream("/com/swingsane/images/swingsane_512x512.png");
    Files.write(IOUtils.toByteArray(iconStream), iconFile);
    iconStream.close();
    String desktopLauncherString = "#!/usr/bin/env xdg-open\n\n";
    desktopLauncherString += "[Desktop Entry]\n";
    desktopLauncherString += "Name=SwingSane\n";
    desktopLauncherString += "Exec=java -jar " + jarPath + "\n";
    desktopLauncherString += "Path=" + path + "\n";
    desktopLauncherString += "Icon=" + path + File.separator + "swingsane_512x512.png\n";
    desktopLauncherString += "Terminal=false\n";
    desktopLauncherString += "Type=Application\n";
    desktopLauncherString += "Categories=Office;Application;";
    LOG.debug(String.format(Localizer.localize("WritingLauncherFileMessage"),
        launcherFile.getCanonicalPath()));
    Files.write(desktopLauncherString.getBytes(), launcherFile);
    try {
      String[] cmdArray = { "chmod", "+x", launcherFile.getCanonicalPath() };
      Runtime.getRuntime().exec(cmdArray);
    } catch (Exception e) {
      LOG.warn(e, e);
    }
  } catch (URISyntaxException e) {
    LOG.warn(e, e);
  } catch (IOException e) {
    LOG.warn(e, e);
  }
}