de.lessvoid.nifty.screen.ScreenController Java Examples
The following examples show how to use
de.lessvoid.nifty.screen.ScreenController.
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. You may check out the related API usage on the sidebar.
Example #1
Source File: TestIssue1013.java From jmonkeyengine with BSD 3-Clause "New" or "Revised" License | 4 votes |
@Override public void simpleInitApp() { // this box here always renders Box b = new Box(1, 1, 1); Geometry geom = new Geometry("Box", b); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", assetManager.loadTexture("/com/jme3/app/Monkey.png")); geom.setMaterial(mat); rootNode.attachChild(geom); niftyDisplay = NiftyJmeDisplay.newNiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort); Nifty nifty = niftyDisplay.getNifty(); nifty.loadStyleFile("nifty-default-styles.xml"); nifty.loadControlFile("nifty-default-controls.xml"); ScreenController ctrl = this; new ScreenBuilder("start") { { controller(ctrl); layer(new LayerBuilder() { { childLayoutVertical(); panel(new PanelBuilder() { { childLayoutCenter(); width("100%"); height("50%"); backgroundColor("#ff0000"); } }); control(new ButtonBuilder("RestartButton", "Restart Context") { { alignCenter(); valignCenter(); height("32px"); width("480px"); interactOnClick("restartContext()"); } }); } }); } }.build(nifty); guiViewPort.addProcessor(niftyDisplay); nifty.gotoScreen("start"); flyCam.setDragToRotate(true); }