0

I'm trying to create some simple elements like a textfield and a textbutton in LibGDX, and to do that, it's supposedly necessary to load a skin which I guess determines the layout and design of the elements.

    Skin skin = new Skin(Gdx.files.internal("uiskin.atlas"));
    nickNameField = new TextField("Enter nickname: ", skin);
    playButton = new TextButton("Find match", skin);

However, while trying to load default skins like uiskin.json and uiskin.atlas, I get errors:

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Error reading pack file: uiskin.atlas
    at com.badlogic.gdx.graphics.g2d.TextureAtlas$TextureAtlasData.<init>(TextureAtlas.java:187)
    at com.badlogic.gdx.graphics.g2d.TextureAtlas.<init>(TextureAtlas.java:231)
    at com.badlogic.gdx.graphics.g2d.TextureAtlas.<init>(TextureAtlas.java:226)
    at com.badlogic.gdx.graphics.g2d.TextureAtlas.<init>(TextureAtlas.java:216)
    at com.badlogic.gdx.scenes.scene2d.ui.Skin.<init>(Skin.java:70)
    at com.mygdx.game.Battleship.create(Battleship.java:41)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:143)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Invalid line: <html lang="en" class="">
    at com.badlogic.gdx.graphics.g2d.TextureAtlas.readTuple(TextureAtlas.java:443)
    at com.badlogic.gdx.graphics.g2d.TextureAtlas$TextureAtlasData.<init>(TextureAtlas.java:115)
    ... 7 more

Anyone know the reason this?

Community
  • 1
  • 1
user1803704
  • 27
  • 1
  • 1
  • 4

1 Answers1

0

Make sure you downloaded RAW files if you got the files from github.

enter image description here

Zohaib Amir
  • 3,482
  • 2
  • 11
  • 29