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

FlxAtlasFrames#fromLibGdx(): fix offset for whitespace-stripped atlases #1923

Merged
merged 12 commits into from
Sep 1, 2016

Conversation

IBwWG
Copy link
Contributor

@IBwWG IBwWG commented Sep 1, 2016

No description provided.

@Gama11
Copy link
Member

Gama11 commented Sep 1, 2016

I'm going to wait on this one until libgdx/libgdx#4288 gets a reply.. I'm not familiar with the format at all.

@IBwWG
Copy link
Contributor Author

IBwWG commented Sep 1, 2016

Sure, if you want. But with flixel how it is now, it produces funny output like this:

mg-libgdx-offset-bug

This PR fixes that. Whether libgdx folk think that's how it should work or not, currently there's a mismatch between libgdx's output and what flixel does with it. If they change libgdx, that would be the time to change flixel back, I think. If they don't, it's fixed.

(Actually, the output's even funnier looking with debug drawing on if you compare with the original unpacked sprites, because she's stuck to the top of the debug box on every frame rather than rooted near the bottom.)

@Gama11
Copy link
Member

Gama11 commented Sep 1, 2016

The TexturePackerAtlas demo simply doesn't have any assets that use this feature? I didn't notice any issues there.

@IBwWG
Copy link
Contributor Author

IBwWG commented Sep 1, 2016

You mean the demo? It has one that uses a libgdx atlas (although maybe not with whitespace stripping used? not sure), but you'll only notice on sprites that aren't vertically centred, if you also know exactly where you expect the sprite to be (debug mode boxes help here.)

@IBwWG
Copy link
Contributor Author

IBwWG commented Sep 1, 2016

Correction, I think the demo does not use a whitespace-stripped atlas: https://github.com/HaxeFlixel/flixel-demos/blob/master/Editors/TexturePackerAtlas/assets/libgdx/test-me.pack#L11 and similar lines all have no offset. The offset tells where the smaller image is, within the extra transparency of the original image.

@Gama11
Copy link
Member

Gama11 commented Sep 1, 2016

I think it would be good if we had an example with this issue in the demo.

@IBwWG
Copy link
Contributor Author

IBwWG commented Sep 1, 2016

(Edit, sorry, first demo I made did not show the problem quite as obviously as the above, so I just used the above graphics.)

Windows source for the demo is here if anyone needs to test libgdx output. Includes yesterday's nightly of the standalone packer:
libgdx-demo.zip

PR for the demo is at HaxeFlixel/flixel-demos#245

@Gama11 Gama11 added the Bug label Sep 1, 2016
@Gama11 Gama11 added this to the 4.2.0 milestone Sep 1, 2016
Gama11 pushed a commit to HaxeFlixel/flixel-demos that referenced this pull request Sep 1, 2016
@Gama11 Gama11 changed the title Libgdx parse fix FlxAtlasFrames#fromLibGdx(): fix offset for whitespace-stripped atlases Sep 1, 2016
@Gama11
Copy link
Member

Gama11 commented Sep 1, 2016

With the demo updated to showcase the bug (and working correctly with your changes), I actually feel fairly confident merging this. Thanks!

@Gama11 Gama11 merged commit bb7260e into HaxeFlixel:dev Sep 1, 2016
Aurel300 pushed a commit to larsiusprime/haxeflixel that referenced this pull request Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants