Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: No com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle registered with name: default
at com.badlogic.gdx.scenes.scene2d.ui.Skin.get(Skin.java:138)
at com.badlogic.gdx.scenes.scene2d.ui.Skin.get(Skin.java:125)
at com.badlogic.gdx.scenes.scene2d.ui.TextField.<init>(TextField.java:114)
at com.mathieu.develop.DevelopController.createButtons(DevelopController.java:56)
at com.mathieu.develop.DevelopController.<init>(DevelopController.java:49)
at com.mathieu.view.GameScreen.show(GameScreen.java:55)
at com.badlogic.gdx.Game.setScreen(Game.java:62)
at com.mathieu.game.MainGame.create(MainGame.java:19)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:132)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:112)
当我尝试这样做时出现此错误:
Skin skin = new Skin(GS.textFieldAtlas);
objectTextFieldSetName = new TextField("Object", skin);
我正在尝试使用两个文件文件创建皮肤:
https://www.dropbox.com/s/85rlj4kjq95y3lv/textures.png https://www.dropbox.com/s/0az61wy2fbsmz8p/textures.pack。
private TextureAtlas loadTexturePack() {
try {
return new TextureAtlas(Gdx.files.internal("images/textures.pack"));
} catch(Exception ex) {
System.out.println(ex);
}
return null;
}
我正在尝试制作一个文本字段,以便我可以输入。任何帮助将不胜感激!