-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs: Text fields #144
Comments
Here's a minimal example for it (excluding imports): public class TextFieldTest extends LightweightGuiDescription {
public TextFieldTest() {
WGridPanel root = new WGridPanel();
setRootPanel(root);
WTextField field = new WTextField();
field.setHost(this); // input won't work if the 'host' is not set
add(field, 0, 0, 5, 1); // height can be any, WTextField#setSize overrides any given y value with 20px
root.validate(this);
}
public static CottonClientScreen createScreen() {
return new CottonClientScreen(new TextFieldTest());
}
} But beware it doesn't support multiline input or output if that's what you need. (see #158) |
FYI, this line isn't needed if you have the |
Thanks! |
Oh wait, the wiki page is still empty: https://github.com/CottonMC/LibGui/wiki/Text-fields |
Hello, I would like to use this library to create a text field for my mod, but the wiki page for this is empty. I would appreciate it if a guide were added on how to create text fields.
The text was updated successfully, but these errors were encountered: