MonoGame.Extended icon indicating copy to clipboard operation
MonoGame.Extended copied to clipboard

TexturePacker format lacking rotation/trimming functionality.

Open anaanook opened this issue 5 years ago • 1 comments

Feel free to close this if I am mistaken, but as far as I can tell the TexturePacker json is lacking a few critical features, mainly sprite trimming/rotation flags.

 {
	"filename": "tiles1.26.png",
	"frame": {"x":160,"y":256,"w":18,"h":32},
	"rotated": true,
	"trimmed": true,
	"spriteSourceSize": {"x":7,"y":0,"w":18,"h":32},
	"sourceSize": {"w":32,"h":32}
},

When imported, TextureRegion2D doesn't seem to track the offset position(x and y of spriteSourceSize) and whether or not the sprite was rotated to fit, as well as correctly drawing them in offset/re-rotated space when using the spritebatch.draw extensions.

Anyways, big fan of the implementation, this one tiny thing is holding me back.

anaanook avatar Sep 18 '19 01:09 anaanook

Yep, it's true. There's currently some limitations on what features you can use in Texture Packer.

The workaround is obviously to not use those features when you're packing your sprites.

A better solution would be to implement those changes in MonoGame.Extended. I'll accept pull requests but please make sure there's a demo included to show that it can load these kinds of texture packer files.

Let's leave this issue open until it's implemented.

craftworkgames avatar Sep 18 '19 02:09 craftworkgames