Reputation: 7
I have a textfield but I don't know how to save the input. I'm using libgdx's scene2d.
txtUsername = new TextField("", mSkin);
txtUsername.setMessageText("test");
txtUsername.setPosition(30, 30);
mStage.addActor(txtUsername);
Upvotes: 0
Views: 179
Reputation: 21658
to get the text you can use txfUsername.getText();
when you say save if you mean in a variable use String yourStringVariable = txfUsername.getText();
I think that saving is basic :), look this similar code : Cannot show user input with a textfield I hope I understood your question
Upvotes: 1