SHARE
TWEET

Untitled

a guest Sep 20th, 2014 157 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("NothingYouCouldDoBold.ttf"));
  2.                 FreeTypeFontParameter parameter = new FreeTypeFontParameter();
  3.                 parameter.size = 12;
  4.                 BitmapFont textFont = generator.generateFont(parameter);
  5.                 generator.dispose(); //Avoiding memory leaks.
  6.                
  7.                
  8.        
  9.         //String text = Gdx.app.getPreferences("prefs").getString("text", "Default text if missing");
  10.         //String txtArea = Gdx.app.getPreferences("prefs").getString("text", "Default text if missing");
  11.         Preferences prefs = Gdx.app.getPreferences("preferences");
  12.        
  13.         Skin skin = new Skin();
  14.         Skin textSkin = new Skin();
  15.         skin.add("font", textFont);
  16.        
  17.         stage = new Stage();
  18.         Gdx.input.setInputProcessor(stage);
  19.         skin = new Skin(Gdx.files.internal("uiskin.json"));
  20.        
  21.         TextFieldStyle textstyle = new TextFieldStyle();
  22.         textstyle.font = textSkin.getFont("textFont");
  23.        
  24.        
  25.  
  26.        
  27.        
  28.         final TextArea textArea = new TextArea(prefs.getString("textArea", "Enter text:"), skin);
  29.         textArea.setX(500);
  30.         textArea.setY(500);
  31.         textArea.setWidth(270);
  32.         textArea.setHeight(270);
  33.         textArea.setMaxLength(50);
  34.        
  35.         final TextField textField = new TextField(prefs.getString("textField", "Enter name:"), textstyle);
  36.                
  37.                
  38.                 textField.setX(500);
  39.                 textField.setY(750);
  40.                 textField.setMaxLength(20);
  41.                 //textField.setWidth(450);
  42.                 //textField.setHeight(200);
  43.                 textField.setSize(400, 200);
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