[LibGDX] [SOLVED] JSON, What does it know how to use?

Ok here it goes

*Skins can use JSON files
*You can define JSON files to stylize the skins

ie.

{
    com.badlogic.gdx.graphics.Color: {
        green: { r: 0, g: 1, b: 0, a: 1 }
    },
    com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: {
        round-green: { name: round, color: green }
    }
}

*How does the JSON file know what image to use?
*Do I name an atlas file the same as the JSON file?

Slightly off topic, but what you had there is not valid JSON. The keys in JSON should be strings.

The libGDX skin files aren’t valid JSON. This is … known behaviour.

In your example, “round” is the name of the sprite (TextureRegion) in your sprite atlas.

By default, yes: new Skin(“myskin.json”) looks for and loads “myskin.atlas”. The skins are pretty flexible though, so it is also possible to create one from scratch, or load/add more texture atlases at runtime.

Thank you brother