Esempio n. 1
0
  private void initNifty() {
    flyCam.setDragToRotate(true);

    loginController = new LoginController();
    loginController.initialize(app.getStateManager(), app);
    nifty.registerScreenController(loginController);
    loginScreenBuilder.buildLoginScreen(nifty, loginController);
    nifty
        .getScreen("LoginScreen")
        .findNiftyControl("PasswordTextField", TextField.class)
        .enablePasswordChar('*');
  }
  /**
   * Main method.
   *
   * @param args arguments
   */
  public static void main(final String[] args) throws IOException {
    if (!LwjglInitHelper.initSubSystems("Nifty Hello World")) {
      System.exit(0);
    }

    // create nifty
    Nifty nifty =
        new Nifty(
            new LwjglRenderDevice(),
            new OpenALSoundDevice(),
            LwjglInitHelper.getInputSystem(),
            new AccurateTimeProvider());

    final HelloWorldStartScreen screen = new HelloWorldStartScreen();
    nifty.registerScreenController(screen);

    screen.prepareStart(nifty);

    nifty.fromXml("src/main/resources/helloworld/helloworld.xml", "start");

    LwjglInitHelper.renderLoop(nifty, null);
    LwjglInitHelper.destroy();
  }