public void quit(){ nifty.gotoScreen("end"); }
/** * Invoked when the event is started. */ @Override public void onPlay() { log.log(Level.FINEST, "screen should be {0}", screen); nifty.gotoScreen(screen); }
@Override public void onPlay() { System.out.println("screen should be " + screen); nifty.gotoScreen(screen); }
@Override public void goToScreen(String screen) { nifty.gotoScreen(screen); }
@Override public void cancelMapSelection() { nifty.gotoScreen("skirmishLobby"); }
void goToScreen(String screen) { nifty.gotoScreen(screen); }
public void goToScreen(String screen) { nifty.gotoScreen(screen); }
public void gotoScreen(@Nonnull final String screenId) { nifty.gotoScreen(screenId); } }
/** * Initialize this Nifty instance from the given xml file. * * @param filename filename to nifty xml * @param startScreen screen to start exec */ public void fromXml(@Nonnull final String filename, @Nonnull final String startScreen) { prepareScreens(filename); loadFromFile(filename); gotoScreen(startScreen); }
/** * fromXml. * * @param fileId fileId * @param input inputStream * @param startScreen screen to start */ public void fromXml( @Nonnull final String fileId, @Nonnull final InputStream input, @Nonnull final String startScreen) { prepareScreens(fileId); loadFromStream(input); gotoScreen(startScreen); }
/** * fromXml with ScreenControllers. * * @param fileId fileId * @param input inputStream * @param startScreen screen to start * @param controllers controllers to use */ public void fromXml( @Nonnull final String fileId, @Nonnull final InputStream input, @Nonnull final String startScreen, @Nonnull final ScreenController... controllers) { registerScreenController(controllers); prepareScreens(fileId); loadFromStream(input); gotoScreen(startScreen); }
/** * Initialize this Nifty instance from the given xml file. * * @param filename filename to nifty xml * @param startScreen screen to start exec * @param controllers controllers to use */ public void fromXml( @Nonnull final String filename, @Nonnull final String startScreen, final ScreenController... controllers) { registerScreenController(controllers); prepareScreens(filename); loadFromFile(filename); gotoScreen(startScreen); }
protected void initHud(String resource) { Screen hud = nifty.getScreen(HUD_SCREEN_ID); // Load the level dictionary if (resource != null) { String levelResource = "Interface/Texts/".concat(resource); try { nifty.addResourceBundle("level", Main.getResourceBundle(levelResource)); } catch (Exception ex) { logger.log(Level.WARNING, "Failed to load the level dictionary!", ex); } } // Load the HUD initHud = true; nifty.gotoScreen(PlayerScreenController.HUD_SCREEN_ID); hud.layoutLayers(); }
@Override public void mapSelected() { ListBox<TableRow> listBox = screen.findNiftyControl("mapsTable", ListBox.class); int selectedMapIndex = listBox.getSelectedIndices().get(0); state.getLobbyState().setMap(selectedMapIndex); nifty.gotoScreen("skirmishLobby"); }
nifty.gotoScreen(startScreen.getName());
private void initNifty() { /** Create a new NiftyGUI object */ niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort); nifty = niftyDisplay.getNifty(); nifty.setIgnoreKeyboardEvents(true); /** Read your XML and initialize your custom ScreenController */ nifty.fromXml("jadex3d/interface/BaseHud.xml", "hud", new DefaultGuiController(this)); nifty.fromXml("jadex3d/interface/BaseHud.xml", "default", new DefaultGuiController(this)); nifty.gotoScreen("hud"); guiViewPort.addProcessor(niftyDisplay); }
nifty.fromXml(niftyExample.getMainXML(), niftyExample.getStartScreen()); } else { nifty.gotoScreen(niftyExample.getStartScreen());