public void createScreen(Nifty nifty) { nifty.loadControlFile("nifty-default-controls.xml"); nifty.loadStyleFile("nifty-default-styles.xml"); new ScreenBuilder("ShowQuestObjective", null) { { layer(new LayerBuilder("background") { { backgroundImage("resources/images/Book.png"); // Using the builder pattern create a ScrollPanel with the id "scrollPanelId" that uses an image as the content to be scrolled around childLayoutAbsoluteInside(); control(new ScrollPanelBuilder("scrollPanel") {{ x("0px"); y("0px"); width("100%"); height("100%"); set( "vertical", "true" ); set( "horizontal", "true" ); text(new TextBuilder("textLabelBonusCharacter") {{ x("0px"); y("5px"); visibleToMouse(false); font("resources/fonts/console.fnt"); textHAlignCenter(); textVAlignCenter(); width("50px"); color(Color.WHITE); text("BĂ´nus"); }}); }}); } }); } }.build(nifty); nifty.gotoScreen("ShowQuestObjective"); nifty.getCurrentScreen().startScreen(); }