stage = new Stage(new FitViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()));
Gdx.input.setInputProcessor(stage);
TextField.TextFieldStyle style = new TextField.TextFieldStyle();
style.font = font;
style.fontColor = Color.BLACK;
style.cursor =
style.selection = new Image(new Texture("core/assets/skin/textfield-big.png")).getDrawable();
style.background = new Image(new Texture("core/assets/skin/textfield-big.png")).getDrawable();
text = new TextField("Name", style);
text.setWidth(500);
text.setHeight(37);
text.setPosition(50, 50);
stage.addActor(text);
When I draw my stage, I can see my textfield
, but when I hover it, my cursor doesn't change, and when I focus I can't see that blinking " | " at all, like normal textfields have.
What did I do wrong? Is it because style.cursor
is null? If yes, how can I set it to the default cursor that libgdx uses?