libgdx-skins
libgdx-skins copied to clipboard
added checks to prevent crash when style not present
Added checks to prevent crash when style not present (Image, TextButton..)
I'm guessing you didn't mean to commit all this?
I did. The majority of the files are from 2 skins I have added. I have copied two skins from https://github.com/czyzby/gdx-skins to see whether new skins could be added, but they initially could not. I noticed that for those skins there isn't always a 'default' style for a given Skin. For example for the TextButton there is no TextButtonStyle element defined.
This caused the previewer to crash. Therefore, before the previewer shows an element, it checks whether that element exists in the Skin with a 'default' style.
Now it works (i.e.: it does not crash and simply show a message). That said, it can be improved further because with those 2 skins the TextButtons are using a ninepatch which is not shown very nicely with the previewer. That might require further modification.
You just need to supply the skin folder with assets and an info.json, you dont need to build then commit these the resulting war.
see https://github.com/libgdx/libgdx-skins#submitting-your-skin
ok, I removed the raw files. Let me know.
The raw files as in the link i posted are the only files you need, see the current skins if you want to see the layout. You have pushed the working files from the war directory which shouldn't be included.
Looks great, Thanks!. If you can just run the LibGDX code formatter over only the lines of code you have changed, then it's good for merging.