Advertisement
Guest User

Untitled

a guest
Mar 15th, 2012
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | None | 0 0
  1.     public void createScreen(Nifty nifty) {
  2.         nifty.loadControlFile("nifty-default-controls.xml");
  3.         nifty.loadStyleFile("nifty-default-styles.xml");
  4.  
  5.         new ScreenBuilder("ShowQuestObjective", null) {
  6.             {
  7.                 layer(new LayerBuilder("background") {
  8.                     {
  9.                         backgroundImage("resources/images/Book.png");
  10.                             // Using the builder pattern create a ScrollPanel with the id "scrollPanelId" that uses an image as the content to be scrolled around
  11.                         childLayoutAbsoluteInside();
  12.                         control(new ScrollPanelBuilder("scrollPanel") {{
  13.                           x("0px"); y("0px");                          
  14.                           width("100%"); height("100%");
  15.                           set( "vertical", "true" );
  16.                           set( "horizontal", "true" );
  17.                          
  18.                             text(new TextBuilder("textLabelBonusCharacter") {{
  19.                                 x("0px"); y("5px"); visibleToMouse(false);
  20.                                 font("resources/fonts/console.fnt");
  21.                                 textHAlignCenter(); textVAlignCenter(); width("50px");
  22.                                 color(Color.WHITE); text("Bônus");
  23.                             }});
  24.                         }});
  25.                     }
  26.                 });
  27.             }
  28.         }.build(nifty);
  29.        
  30.         nifty.gotoScreen("ShowQuestObjective");
  31.         nifty.getCurrentScreen().startScreen();
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement