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

Add support for flipped FlxFrames #1591

Merged
merged 4 commits into from
Aug 31, 2015
Merged

Conversation

larsiusprime
Copy link
Member

Adding support for flipped FlxFrames. This lets you get your atlases packed even tighter by re-using mirror images.

@sruloart
Copy link
Contributor

Good thinking! talking about tighter packing, do you think your MaxRects implementation can work with FlxAtlas? currently it's missing a proper packing algorithm.

@larsiusprime
Copy link
Member Author

Yeah!

I just added a readme:
https://github.com/larsiusprime/tdrpg-tools/tree/master/dqsprite

The tool itself is a bit hacky and designed specifically for defender's quest, but you can probably just look at what it's doing and get most of what you need right from there. I set it up to export a sparrow-compatible xml file and then feed it straight into FlxAtlas. It's working in my game right now.

@Gama11 Gama11 changed the title Frameflip Add support for flipped FlxFrames Aug 27, 2015
@Gama11
Copy link
Member

Gama11 commented Aug 27, 2015

I'll let @Beeblerox review this one.

@Gama11 Gama11 added this to the 4.0.0 milestone Aug 27, 2015
@larsiusprime
Copy link
Member Author

@sruloart:

My EntitySprite class in flixel-editors (more like flixel-lars'-weird-experiments, lol) makes use of this if you want more examples

https://github.com/HaxeFlixel/flixel-editors/blob/dev/flixel/editors/EntitySprite.hx

@@ -256,6 +258,8 @@ class FlxAtlasFrames extends FlxFramesCollection
name = texture.att.name;
trimmed = texture.has.frameX;
rotated = (texture.has.rotated && texture.att.rotated == "true") ? true : false;
flipX = (texture.has.flipX && texture.att.flipX == "true") ? true : false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the ternaries here, these are already boolean expressions. :)

Beeblerox added a commit that referenced this pull request Aug 31, 2015
Add support for flipped FlxFrames
@Beeblerox Beeblerox merged commit 426c9b6 into HaxeFlixel:dev Aug 31, 2015
@larsiusprime larsiusprime deleted the frameflip branch October 20, 2015 19:15
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.

4 participants