Sprites - Two Problems

I have many different animated sprites all coming from the same sprite sheet made in zwoptex. I have two problems that I could use some help on.

First - Physics
For whatever reason, when adding physics bodies to my animations I MUST hard code the body coordinates otherwise every animation inherits the body size of the first frame in my sprite sheet. Is this a known bug?

Second - Scaling
Adding all the sprites into the same display group and then performing the following transition causes ALL the sprites to move around within the display group as it shrinks. NOT keeping the same layout as I would expect. Am I doing something wrong? BTW - this scenario has NO physics
[lua]transition.to(allLayersGroup, {time=1000, xScale=.35, yScale=.35})[/lua]

Thanks in advance for any help. I’m really getting frustrated with this one.

[import]uid: 9187 topic_id: 4069 reply_id: 304069[/import]

point 2)

if you’re using hybrid or debug display for physics then yes you will see this behaviour

discussed here;
http://developer.anscamobile.com/forum/2010/11/14/ge-displaygroup-breaks-physics-coordinatesscale

there’s a reply from ansca in a separate thread but I can’t find it.

j [import]uid: 6645 topic_id: 4069 reply_id: 12556[/import]

Unfortunately, I am not using physics when I experience the sprite scaling issue. So I’m still scratching my head. [import]uid: 9187 topic_id: 4069 reply_id: 12572[/import]

Maybe this might be an issue with SetReferencePoint in Corona. I’ve experienced some strange things when using them and maybe the scaling functions use this in some way.

Have you tried setting the reference points before inserting them in a group? [import]uid: 11024 topic_id: 4069 reply_id: 12573[/import]

Thanks for the tip, I tried all different reference points but never setting it before inserting into the group. But unfortunately, this didn’t work.

I have a lead. I checked an older build using previous version of my graphics and there are no problems. I swapped out my new sprite sheet with the old and everything works fine. Tried creating the new one again with zwoptex and still getting the problem.

Could it possibly have something to do with my source png files going into the sprite sheet? I can’t see how that would be a problem, my designer uses the same method of saving files consistently. [import]uid: 9187 topic_id: 4069 reply_id: 12581[/import]

Well, I got the scaling problem working. I still don’t understand why so let me post my results.

Here is the sprite sheet reference to my original WORKING frame:
[lua]{
name = “jewel.png”,
spriteColorRect = { x = 0, y = 0, width = 64, height = 98 },
textureRect = { x = 280, y = 1, width = 64, height = 98 },
spriteSourceSize = { width = 64, height = 98 },
spriteTrimmed = true,
textureRotated = false
},[/lua]

And the new BROKEN frame, notice its the same with a bit more transparent space:
[lua]{
name = “jewel_01.png”,
spriteColorRect = { x = 0, y = 1, width = 68, height = 100 },
textureRect = { x = 288, y = 1, width = 68, height = 100 },
spriteSourceSize = { width = 68, height = 128 },
spriteTrimmed = true,
textureRotated = false
},[/lua]

However, if I take this same broken frame and save the sprite sheet UNTRIMMED, it works:
[lua]{
name = “jewel_01.png”,
spriteColorRect = { x = 0, y = 1, width = 68, height = 100 },
textureRect = { x = 346, y = 1, width = 68, height = 128 },
spriteSourceSize = { width = 68, height = 128 },
spriteTrimmed = false,
textureRotated = false
},[/lua]

Any ideas why my first frame works when its trimmed, but my new one doesn’t? I will have to double the width of my sprite sheet to make room for the untrimmed pixels so I would love to figure this problem out.

Thanks! [import]uid: 9187 topic_id: 4069 reply_id: 12586[/import]

Attached is a screen shot of my two images. The trimmed one is the original working version, the larger one has transparent space added to help with lining up to other images.

[import]uid: 9187 topic_id: 4069 reply_id: 12592[/import]

@tempop

  1. SpriteSheets + reference point = known SDK bug.

  2. All your physics objects have to be in the same group.
    [import]uid: 7356 topic_id: 4069 reply_id: 12594[/import]

I must be missing something about sprites. I am creating a texture PNG with non-uniformly shaped frames but I can not figure out how to specify the registration point of each frame. Do all frames have to be aligned to the upper-left corner? [import]uid: 24938 topic_id: 4069 reply_id: 18942[/import]