TexturePacker, spritsheets and @2x images...

@danedwar:
edit your exporter and add “* 0.5” after all of the values [or other multiplier you need].
When not using trimming this worked flawlessly for me. Now I’ll test it with trimming, but I think it would be pushing it :wink:

Anyway, just edit your exporter, generate the HD imagesheet and use imagemagick/automator/whatever else [even preview] to create an SD copy of your imagesheet.

Don’t forget to put the * 0.5 to the width and height of your imagesheet values in your exporter! [import]uid: 109453 topic_id: 30336 reply_id: 122632[/import]

There seems to be a problem with the trimming in Corona, I’ve checked the imagesheets and they are all fine - only seems to happen when sprites are trimmed.

Seems to be something to do with the scaling of the trimmed area - not 100% yet, but it is affecting the positioning and size of my sprites. [import]uid: 77943 topic_id: 30336 reply_id: 123238[/import]

Hmm I didn’t see this problem in my tests [still tests as I’m waiting for the command line option :/].
Make sure you have all of your sprites with even dimensions. [import]uid: 109453 topic_id: 30336 reply_id: 123239[/import]

Looks like there’s already a bug posted.

15619 “Imagesheet - loading of trimmed sprites using newImageRect is broken!”

It has been around for a couple of months though. Danny and Tom Newman are playing pass the parcel with the bug :slight_smile: [import]uid: 77943 topic_id: 30336 reply_id: 123240[/import]

Nice one! I didn’t think of that :slight_smile:
I’ve been using trimming and it seems to work fine as long as the common divisor is set correctly for the highest res you are using.
[import]uid: 77943 topic_id: 30336 reply_id: 122806[/import]

I’ve just downloaded the latest beta 3.0.0b16 and force identical layout has been added.

Just given it a quick spin and looks like it’s all there and working!! Even sorts out the common divisor for you when you setup your scales in auto sd :slight_smile:

Thanks Andreas! [import]uid: 77943 topic_id: 30336 reply_id: 122810[/import]

Yeah, I’ve given it a try few moments ago. Everything works great, unfortunately the ‘force identical layout’ option was not added as the command line option.
I’ve got so many different imagesheets created, that creating a tps file for each and every one of them would be just a waste of time. Especially if I wanted to change a single thing in all of them later on. [import]uid: 109453 topic_id: 30336 reply_id: 122812[/import]

Whoa, who would have thought I was going to spark such a discussion! he he…

I’m currently worrying about other stuff, but when I get around to it I’ll play around with all things that have been mentioned, see what I can come up with. [import]uid: 136402 topic_id: 30336 reply_id: 122852[/import]

Crap… always something…
I would love to finally publish my game, but with bugs like this I loose any hope.

I think I’ve bought corona license for a single game, which will probably not return the cost of the license, not to mention development. FFS. [import]uid: 109453 topic_id: 30336 reply_id: 123531[/import]

There seems to be a problem with the trimming in Corona, I’ve checked the imagesheets and they are all fine - only seems to happen when sprites are trimmed.

Seems to be something to do with the scaling of the trimmed area - not 100% yet, but it is affecting the positioning and size of my sprites. [import]uid: 77943 topic_id: 30336 reply_id: 123238[/import]

Hmm I didn’t see this problem in my tests [still tests as I’m waiting for the command line option :/].
Make sure you have all of your sprites with even dimensions. [import]uid: 109453 topic_id: 30336 reply_id: 123239[/import]

Looks like there’s already a bug posted.

15619 “Imagesheet - loading of trimmed sprites using newImageRect is broken!”

It has been around for a couple of months though. Danny and Tom Newman are playing pass the parcel with the bug :slight_smile: [import]uid: 77943 topic_id: 30336 reply_id: 123240[/import]

Crap… always something…
I would love to finally publish my game, but with bugs like this I loose any hope.

I think I’ve bought corona license for a single game, which will probably not return the cost of the license, not to mention development. FFS. [import]uid: 109453 topic_id: 30336 reply_id: 123531[/import]

So I figured out the problem with my positioning of trimmed sprites and images. When my designer gives me an image or set of sprites they are not trimmed, I then use these images to create imagesheets and the images are trimmed. However the positioning of images and sprites are given to me by the designer and are always top left. When I create images from the trimmed imagesheet the size of the image create is the trimmed size and not the original so the positions will be off by the trimmed amount.

I then have to use the data form texture packer to work out what this offset will be and move the images by the relevant amount. I found that with sprites I had to use center co-ordinates for this to be reliable.

The other place where this causes a problem that I have not been able to resolve is for buttons that are using trimmed imagesheets. My designer will give me two images for a buttons idle and hit state. The images will be provided with the same dimensions but when trimmed one of the states is usually a lot smaller/larger (button shrinking or growing when pressed). When the images are used by the button through an imagesheet one of the states will have been scaled up/down to the same size as the other state meaning the gfx are not displayed as intended.
[import]uid: 77943 topic_id: 30336 reply_id: 124874[/import]

So I figured out the problem with my positioning of trimmed sprites and images. When my designer gives me an image or set of sprites they are not trimmed, I then use these images to create imagesheets and the images are trimmed. However the positioning of images and sprites are given to me by the designer and are always top left. When I create images from the trimmed imagesheet the size of the image create is the trimmed size and not the original so the positions will be off by the trimmed amount.

I then have to use the data form texture packer to work out what this offset will be and move the images by the relevant amount. I found that with sprites I had to use center co-ordinates for this to be reliable.

The other place where this causes a problem that I have not been able to resolve is for buttons that are using trimmed imagesheets. My designer will give me two images for a buttons idle and hit state. The images will be provided with the same dimensions but when trimmed one of the states is usually a lot smaller/larger (button shrinking or growing when pressed). When the images are used by the button through an imagesheet one of the states will have been scaled up/down to the same size as the other state meaning the gfx are not displayed as intended.
[import]uid: 77943 topic_id: 30336 reply_id: 124874[/import]

Hi! I have big swf file, and i want to make sprite sheet from. It is to big and i want to make to atlases. Im using multipack and its putting subtextures to png without right sorting (1 frame of animation is in one png, second in another). What option should i use to make the right order of frames in both pngs?

Hi @ghost_of_vitor,

Under the “Layout” sub-menu, select “Basic” for the “Algorithm” drop-down (not “MaxRects”). This will expose “Sort by” and “Sort Order” options.

Hope this helps,

Brent

Hi! I have big swf file, and i want to make sprite sheet from. It is to big and i want to make to atlases. Im using multipack and its putting subtextures to png without right sorting (1 frame of animation is in one png, second in another). What option should i use to make the right order of frames in both pngs?

Hi @ghost_of_vitor,

Under the “Layout” sub-menu, select “Basic” for the “Algorithm” drop-down (not “MaxRects”). This will expose “Sort by” and “Sort Order” options.

Hope this helps,

Brent