Skin Composer - Create skins for scene2d.ui

Any community contributions to libgdx go here! Some may get included in the core API when permission is granted.

Skin Composer - Create skins for scene2d.ui

Postby raeleus » Fri May 27, 2016 6:13 am

Hello all! I created an application to create skins for scene2d.ui:

Image

I created Skin Composer for the LibGDX community and it's free for anyone to use for their projects.

Skin Composer Summary
Download
Guide
Source Code

I made this program because I like working with UI skins but I hate editing text files. There is another libGDX skin editor out there, but the bugs and lack of certain features I needed were a deal breaker.

I haven't done much testing in Linux and I don't have a Mac at all. If you guys can help me test on those platforms as well as post any comments or bug reports I would greatly appreciate it. OpenJDK seems to hate what I'm doing so use the Oracle JVM instead. Allow me to apologize about the spaghetti code before you look at the source.

Thanks for taking the time to check it out!

Image
Last edited by raeleus on Sun Sep 18, 2016 4:20 am, edited 2 times in total.
Join us on Discord for faster and friendlier service.
Create skins visually with Skin Composer.
raeleus
 
Posts: 441
Joined: Wed Aug 07, 2013 10:57 pm

Re: Skin Composer - Create skins for scene2d.ui

Postby Czyzby » Fri May 27, 2016 1:23 pm

It seems to work on Linux (Mint), although I get this error a lot (when trying to import/export skins):
Code: Select all
java.lang.UnsupportedOperationException: TRANSLUCENT translucency is not supported.
   at java.awt.Window.setOpacity(Window.java:3633)
   at java.awt.Dialog.setOpacity(Dialog.java:1333)
   at com.ray3k.skincomposer.utils.SynchronousJFXCaller.call(SynchronousJFXCaller.java:65)
   at com.ray3k.skincomposer.utils.SynchronousJFXFileChooser.showDialog(SynchronousJFXFileChooser.java:96)
   at com.ray3k.skincomposer.utils.SynchronousJFXFileChooser.showDialog(SynchronousJFXFileChooser.java:58)
   at com.ray3k.skincomposer.utils.SynchronousJFXFileChooser.showSaveDialog(SynchronousJFXFileChooser.java:125)
   at com.ray3k.skincomposer.panel.PanelMenuBar.lambda$exportDialog$33(PanelMenuBar.java:530)
   at com.ray3k.skincomposer.dialog.DialogLoading.lambda$show$15(DialogLoading.java:56)
   at com.badlogic.gdx.scenes.scene2d.actions.RunnableAction.run(RunnableAction.java:42)
   at com.badlogic.gdx.scenes.scene2d.actions.RunnableAction.act(RunnableAction.java:32)
   at com.badlogic.gdx.scenes.scene2d.actions.SequenceAction.act(SequenceAction.java:65)
   at com.badlogic.gdx.scenes.scene2d.Actor.act(Actor.java:95)
   at com.badlogic.gdx.scenes.scene2d.Group.act(Group.java:46)
   at com.badlogic.gdx.scenes.scene2d.Group.act(Group.java:49)
   at com.badlogic.gdx.scenes.scene2d.Stage.act(Stage.java:222)
   at com.ray3k.skincomposer.Main.render(Main.java:269)
   at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:252)
   at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:127)
   at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:97)
   at com.ray3k.skincomposer.desktop.DesktopLauncher.main(DesktopLauncher.java:41)


The UI is very, hm, noisy. The skin you used for the composer would work pretty well for a simple game, but when using developer tools, I expect them not to hurt my eyes after a while. ; ) I suggest changing the color scheme to something similar to VisUI.

Might I ask why you've chosen BitBucket over GitHub or GitLab?
Czyzby
 
Posts: 173
Joined: Tue Jan 07, 2014 6:32 pm

Re: Skin Composer - Create skins for scene2d.ui

Postby raeleus » Fri May 27, 2016 1:30 pm

Thanks for checking it out. Were you testing it in a virtual machine or was it a normal installation?

I'll take your suggestion on the theme.

Bitbucket was suggested to me in a book. It allows for free private repositories. It's all I know and I'm rather new to the subject of source control.
Join us on Discord for faster and friendlier service.
Create skins visually with Skin Composer.
raeleus
 
Posts: 441
Joined: Wed Aug 07, 2013 10:57 pm

Re: Skin Composer - Create skins for scene2d.ui

Postby Czyzby » Fri May 27, 2016 2:02 pm

I used the jar version and simply run it with my Oracle JRE (8). It seems that the native file choosers are not very portable. Maybe you should consider checking out VisUI file chooser - we're using it for our alternative gdx-setup and it works great. (It also optionally supports different display modes and image miniatures - you should contact Kotcrab, I'm sure he'll be willing to help you set it up.)

For open source projects, I think GitHub is more popular. LibGDX sources are hosted under GitHub, so that's at least one reason to do it.

Oh, and I just wanted to say that I added your new skins (and a note about Skin Composer) in gdx-skins.
Czyzby
 
Posts: 173
Joined: Tue Jan 07, 2014 6:32 pm

Re: Skin Composer - Create skins for scene2d.ui

Postby raeleus » Fri May 27, 2016 2:11 pm

Okay, thanks for the info. I'll take a look at how VisUI does it. It's a shame about the native file choosers. I hate how most Java programs have ugly file choosers without thumbnails or just behave weirdly.

Thanks for including the skins. I'm going to be updating the rest of mine to be compatible with the import function.
Join us on Discord for faster and friendlier service.
Create skins visually with Skin Composer.
raeleus
 
Posts: 441
Joined: Wed Aug 07, 2013 10:57 pm

Re: Skin Composer - Create skins for scene2d.ui

Postby Czyzby » Fri May 27, 2016 4:53 pm

Yeah, Kotcrab is already working on thumbnails. I'm sure he won't mind me sharing this screenshot of some of the newest features.

(Also, if you happen to create or update any skins, I would appreciate creating an issue in gdx-skins.)
Attachments
thumbnails.gif
thumbnails.gif (1.12 MiB) Viewed 14864 times
Last edited by Czyzby on Fri May 27, 2016 5:15 pm, edited 1 time in total.
Czyzby
 
Posts: 173
Joined: Tue Jan 07, 2014 6:32 pm

Re: Skin Composer - Create skins for scene2d.ui

Postby raeleus » Fri May 27, 2016 5:11 pm

Whoah that looks pretty slick! I'm sure I'll find the time to implement it at some point. I would have just used all GDX libraries if it weren't for me being attached to this dumb file chooser.
Join us on Discord for faster and friendlier service.
Create skins visually with Skin Composer.
raeleus
 
Posts: 441
Joined: Wed Aug 07, 2013 10:57 pm

Re: Skin Composer - Create skins for scene2d.ui

Postby Czyzby » Fri May 27, 2016 5:18 pm

Well, it seems to crash on Linux. It's a shame, really, as I can't test your application.

Also, support for custom widgets would be nice. People create their custom controls all the time (even you had to create a few, I assume) - it would be nice if you could add custom code snippets, so you could create styles for widgets outside of the regular Scene2D API.
Czyzby
 
Posts: 173
Joined: Tue Jan 07, 2014 6:32 pm

Re: Skin Composer - Create skins for scene2d.ui

Postby kotcrab » Fri May 27, 2016 7:03 pm

Looks neat but the Windows zip seems to be damaged, I got `Headers error` when extracting using 7zip. Yeah, please use Github for public repositories, Bitbucket feels clumsy to use. You can also use Github to host release binaries.

VisUI FileChooser should handle all your needs, I actually created it because Swing file chooser is terrible. On OSX your application will deadlock if you use something from Swing/JavaFX. AWT Headless stuff is fine though but make sure to enable AWT headless mode or you will also get deadlock. You are using texture packer so you must do that:
Code: Select all
if (OsUtils.isMac()) System.setProperty("java.awt.headless", "true");


Thumbnails are supported via ImgScalr library, while it works on all OSes it can cause heap to grow very quickly when generating thumbnails from large files like photos. There is JVM settings to help with that though or image size limit can be enabled. Now I'm working on native solution using WinAPI, you can see first results on that gif. It's very fast and memory efficient but works on Windows only. If you need help with implementing something from VisUI I'm on IRC (#viseditor on Freenode).
kotcrab
 
Posts: 6
Joined: Sun Apr 06, 2014 6:03 pm

Re: Skin Composer - Create skins for scene2d.ui

Postby raeleus » Fri May 27, 2016 7:43 pm

Excellent! Thanks for the help. I wouldn't have had any idea about texture packer being an issue. I'll take you up on the help, but I'm awfully slow at getting any work done. It all sounds very good though, so I'll be excited to implement it sooner than later.
Join us on Discord for faster and friendlier service.
Create skins visually with Skin Composer.
raeleus
 
Posts: 441
Joined: Wed Aug 07, 2013 10:57 pm

Next

Return to Libgdx Contributions

Who is online

Users browsing this forum: No registered users and 1 guest