SHARE
TWEET

Untitled

a guest Sep 14th, 2014 164 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void show() {
  2.                  
  3.                 String text = Gdx.app.getPreferences("prefs").getString("text", "Default text if missing");
  4.                 String txtArea = Gdx.app.getPreferences("prefs").getString("text", "Default text if missing");
  5.                
  6.                 //Gdx.app.getPreferences("prefs").putString("text", tf.getText()).flush();
  7.                
  8.                 Skin skin = new Skin();
  9.        
  10.                 stage = new Stage();
  11.                 Gdx.input.setInputProcessor(stage);
  12.                 skin = new Skin(Gdx.files.internal("uiskin.json"));
  13.                 TextArea textArea = new TextArea(txtArea, skin);
  14.                 textArea.setX(500);
  15.                 textArea.setY(500);
  16.                 textArea.setWidth(270);
  17.                 textArea.setHeight(270);
  18.                
  19.                
  20.                 TextField textField = new TextField(text, skin);
  21.                 textField.setX(500);
  22.                 textField.setY(750);
  23.                 textField.setWidth(450);
  24.                 textField.setHeight(200);
  25.                
  26.                
  27.                
  28.                 //String text = Gdx.app.getPreferences("prefs").getString("text", "Default text if missimg");
  29.                 //TextField textField = new TextField(text, skin);
  30.                
  31.                 //Backbutton
  32.                                 ImageButtonStyle styleTwo = new ImageButtonStyle();
  33.                                 TextureRegionDrawable arrowImage = new TextureRegionDrawable(new TextureRegion(new Texture("arrowLeft.png")));
  34.                                 styleTwo.up = skin.newDrawable(skin.newDrawable(arrowImage));
  35.                                 styleTwo.down = skin.newDrawable(skin.newDrawable(arrowImage));
  36.                
  37.         btnArrow = new ImageButton(styleTwo);
  38.                
  39.                 btnArrow.setSize(150, 150);
  40.                 btnArrow.setPosition(450, 10);
  41.                
  42.                 stage.addActor(textArea);
  43.                 stage.addActor(textField);
  44.                 stage.addActor(btnArrow);
  45.                
  46.                
  47.                 //Backbutton takes us back to mainmenu
  48.                                 btnArrow.addListener(new ChangeListener() {
  49.  
  50.                                         @Override
  51.                                         public void changed(ChangeEvent event, Actor actor) {
  52.                                                 game.setScreen(new MainScreen(game));
  53.                                                
  54.                                         }
  55.  
  56.                                
  57.                         });
  58.                
  59.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top