raeleus / skin-composer

Create skins for LibGDX scene2d.ui with a graphical interface.
MIT License
427 stars 34 forks source link

Feature request: Ability to change split and padding #37

Closed NicEastvillage closed 5 years ago

NicEastvillage commented 6 years ago

When creating custom drawables, it is currently not possible to be add or change the split or pad properties. To do this you have to manually set those in the atlas by hand.

I suggest adding a small option menu for each drawable, where you are able to set these properties. Some text fields would be enough, but a preview would be amazing.

raeleus commented 6 years ago

Custom drawables are not intended to have any affect on the texture atlas. I usually use them to refer to custom classes that I define in skin composer or drawables manually added to the skin in code.

Can you give me an example of what you're trying to acheive? Keep in mind you have full access to the texture packing settings via Project >> Settings >> Open texture packer settings file. Thanks

NicEastvillage commented 6 years ago

I see. These is are properties for individual textures in the atlas. Heres an example of what I mean:

Here I have loaded up a custom texture, that I want to use for a button. When I scale the button, the texture becomes stretched:

billede

But I want it to split like this:

billede

To do this I have to export the project, open the .atlas and insert these values for splitting (and padding):

billede

Then I need to re-import the project for the changes to apply.

It not a big issue. I just wanted to suggest it, because I thought it would be nice to, if the user was able to adjust these values from within the program without having to search through a file and re-import while iterating.

raeleus commented 6 years ago

The workflow that I want to promote is to use 9patch files to define padding and stretching areas. These files, with appropriate black bars drawn, function correctly with skin composer. Some details here: https://www.gamedevelopment.blog/9-patch-libgdx-tutorial/

GDX texture packer has a great 9 patch tool: https://github.com/crashinvaders/gdx-texture-packer-gui

If you really need to have a dialog for it, it's going to take some work for limited payoff. I'll consider it in a future version.

raeleus commented 5 years ago

I added a nine patch editor in version 23.