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
3 changes: 2 additions & 1 deletion flixel/graphics/frames/FlxAtlasFrames.hx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ class FlxAtlasFrames extends FlxFramesCollection
tempString = lines[curIndex++];
size = getDimensions(tempString, size);

offset = FlxPoint.get(size[0], size[1]);
//offset = FlxPoint.get(size[0], size[1]); // this should be how it is, but libgdx's texture packer tool currently outputs the offset from the bottom left, instead:
offset = FlxPoint.get(size[0], sourceSize.y - size[1] - imageHeight); // workaround for https://github.com/libgdx/libgdx/issues/4288
frames.addAtlasFrame(rect, sourceSize, offset, name, angle);
}

Expand Down