SHARE
TWEET

Untitled

a guest Sep 20th, 2014 208 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.        
  16.         stage = new Stage();
  17.         Gdx.input.setInputProcessor(stage);
  18.         skin = new Skin(Gdx.files.internal("uiskin.json"));
  19.        
  20.         TextFieldStyle textstyle = new TextFieldStyle();
  21.         textstyle.font = textFont;
  22.         //textSkin.add("font", textFont);
  23.        
  24.        
  25.        
  26.        
  27.         final TextArea textArea = new TextArea(prefs.getString("textArea", "Enter text:"), skin);
  28.         textArea.setX(500);
  29.         textArea.setY(500);
  30.         textArea.setWidth(270);
  31.         textArea.setHeight(270);
  32.         textArea.setMaxLength(50);
  33.        
  34.         final TextField textField = new TextField(prefs.getString("textField", "Enter name:"), textstyle);
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