public void init(GameContainer gc, StateBasedGame sbg) throws SlickException {
   super.init(gc, sbg);
   multiLb = new MKLabelNode("Multiplayer");
   multiLb.setPostion(new MKPoint(50, 50));
   multiLb.setFont(new Font("Verdana", Font.BOLD, 50));
   // gc font x y w h
   textField =
       new TextField(
           gc, new TrueTypeFont(new Font("Verdana", Font.BOLD, 30), false), 50, 10, 500, 50);
   textField.setText("username...");
   textField.setCursorPos("username...".length());
 }
Exemple #2
0
 /**
  * Do the undo of the paste, overrideable for custom behaviour
  *
  * @param oldCursorPos before the paste
  * @param oldText The text before the last paste
  */
 protected void doUndo(int oldCursorPos, String oldText) {
   if (oldText != null) {
     setText(oldText);
     setCursorPos(oldCursorPos);
   }
 }