Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TexturePacker and PixmapPacker should get 9-patch support #4942

Closed
BenMcLean opened this issue Oct 25, 2017 · 4 comments
Closed

TexturePacker and PixmapPacker should get 9-patch support #4942

BenMcLean opened this issue Oct 25, 2017 · 4 comments

Comments

@BenMcLean
Copy link
Contributor

BenMcLean commented Oct 25, 2017

Issue details

TextureAtlas.AtlasRegion has the fields "pads" and "splits" for 9-patch information.
These fields get populated if the info is loaded from a .atlas file with the TextureAtlas (FileHandle packFile) constructor.

However, if you use TexturePacker.pack or PixmapPacker.pack to pack your TextureAtlas at runtime using the generateTextureAtlas method, this 9-patch information is lost. There's no way to give TexturePacker or PixmapPacker this information when packing.

I would suggest that there should be a version of the pack methods in TexturePacker and PixmapPacker which accepts this 9-patch info so that it comes out in the regions from generateTextureAtlas.

Reproduction steps/code

I wrote a sort of workaround in this code here which assumes the user will be packing from only one TextureAtlas and that all the names of all the textures will exactly match. However, this is an ugly hack. It would be better if TexturePacker and PixmapPacker handled this.

Version of LibGDX and/or relevant dependencies

All.

Please select the affected platforms

All platforms.

@Tom-Ski
Copy link
Member

Tom-Ski commented Oct 26, 2017

I've added this personally for my projects, and Is a handy feature. Ill see about making a PR for it soon.

@BenMcLean
Copy link
Contributor Author

Looking forward to that! :)

@BenMcLean
Copy link
Contributor Author

Anything happen with this? @Tom-Ski :)

@Tom-Ski
Copy link
Member

Tom-Ski commented Aug 4, 2018

Pushed support to PixmapPacker for this. TexturePacker already supports this.
See 64f2d9d

@Tom-Ski Tom-Ski closed this as completed Aug 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants