0

While learning a bit of libGDX by creating my mini project i decided that i need text input, created text field, a skin for it, but errors occurs with importing default skin.

 Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException:
 com.badlogic.gdx.utils.SerializationException: Error reading file: data/uiskin.json
 at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:113)
 Caused by: com.badlogic.gdx.utils.SerializationException: Error reading file: data/uiskin.json
at com.badlogic.gdx.scenes.scene2d.ui.Skin.load(Skin.java:95)
at com.badlogic.gdx.scenes.scene2d.ui.Skin.<init>(Skin.java:72)
at com.me.bpmtest.BpmTest.create(BpmTest.java:47)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:127)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:110)
Caused by: com.badlogic.gdx.utils.SerializationException: Error reading file:  data/uiskin.json
at com.badlogic.gdx.utils.Json.fromJson(Json.java:613)
at com.badlogic.gdx.scenes.scene2d.ui.Skin.load(Skin.java:93)
... 4 more
Caused by: com.badlogic.gdx.utils.SerializationException: Field not found: scrollStyle (com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle)
at com.badlogic.gdx.utils.Json.readFields(Json.java:703)
at com.badlogic.gdx.utils.Json.readValue(Json.java:816)
at com.badlogic.gdx.scenes.scene2d.ui.Skin$1.readValue(Skin.java:409)
at com.badlogic.gdx.utils.Json.readValue(Json.java:766)
at com.badlogic.gdx.scenes.scene2d.ui.Skin$2.readNamedObjects(Skin.java:434)
at com.badlogic.gdx.scenes.scene2d.ui.Skin$2.read(Skin.java:422)
at com.badlogic.gdx.scenes.scene2d.ui.Skin$2.read(Skin.java:415)
at com.badlogic.gdx.utils.Json.readValue(Json.java:791)
at com.badlogic.gdx.scenes.scene2d.ui.Skin$1.readValue(Skin.java:409)
at com.badlogic.gdx.utils.Json.fromJson(Json.java:611)
... 5 more

I use default skin files from here Here's code snippet of my create function:

 public void create() {  
 skin = new Skin(Gdx.files.internal("data/uiskin.json"));
 //Gdx.input.setOnscreenKeyboardVisible(true);      - for android later.
 AndroidInput listener = new AndroidInput();
 stage = new Stage();
 textfield = new TextField("", skin);
 textfield.setMessageText("Enter Push number");

 ....

 }

I'm really just a beginner here, maybe there is simpler way to get text input? I need to get integer from a user.

  • possible duplicate of [Using scene2d.ui with libgdx: where does the skin come from?](http://stackoverflow.com/questions/18526116/using-scene2d-ui-with-libgdx-where-does-the-skin-come-from) – Don Kirkby Jul 20 '14 at 05:10

1 Answers1

0

Check the tools box on the libgdx launch screen. Then you will have all the default files that are used in many libgdx examples including uiskin.json. After you do that you can just call Gdx.files.internal("uiskin.json")

Derek Dawson
  • 502
  • 5
  • 14