Game Edition: use of sprite sheet causes iOS build to not function

I have a simple game. Runs great in simulator, is uses a sprite sheet created with Zwoptex.

When I compile it to iOS and test it on my iPad or iPod Touch 2nd Gen, code execution seems to stop dead in its tracks at the point where the sprite sheet code is referenced.

Everything before that point “runs”. which in my case was just a few loops and non-physics display objects, but everything after it didn’t execute.

When I remove the sprite sheet code and just put in a regular display image, it works fine.

The sprite sheet had physics on it, if that makes a difference, however I don’t think it got that far, as it wasn’t even visible on screen. [import]uid: 7473 topic_id: 3814 reply_id: 303814[/import]

Hi, I’ve reported this for awhile now. This is the current workaround. Just don’t use the data file and make sure you use equal spaced frames in the sheet.

http://developer.anscamobile.com/issues/3508

[import]uid: 11024 topic_id: 3814 reply_id: 11586[/import]

joe

can you send me the spritesheet and the zwoptext code?

@finnk did anyone responded yet?

carlos [import]uid: 24 topic_id: 3814 reply_id: 11669[/import]

There is also another bad issue with (non-uniformly sized) Sprite Sheets:

If you display a simple animation (created with Zwoptex, non-uniformly sized frames) the animation starts to “jitter” while playing when it has been scaled or rotated.

To reproduce it:

  • Create a simple animation using Zwoptex (trim = on)
  • Load & display the animation in Corona
  • Scale it to 1.5, for example and rotate steadily (using enterFrame etc.)

This makes using Sprite Sheets (at least using non-uniformly sized frames) quite useless :frowning:

However, I really have to use non-uniformly sized frames since I need to put all my frames on one texture. Using same sized frames is a huge waste of valuable memory though.

Will there be a fix soon? [import]uid: 9644 topic_id: 3814 reply_id: 11684[/import]

Hi Carlos, this is actually Michael (an engineer) posting with Joe’s account.

I managed to get it working. It was a file path issue. The sprite sheet data file from Zwoptex was being stored in a subdirectory in my LUA project folder, and for some reason this folder was not translating well to the compiled version.

I moved the exact same file, unchanged, to the root directory, and it works fine… so that should help you diagnose that particular issue.

I now have spritesheets running on the device just fine. [import]uid: 7473 topic_id: 3814 reply_id: 11694[/import]

desetto, do you use uniformly sized animation frames?

If not, do your (trimmed) Zwoptex animations also jitter when scaled or when you rotate them? This makes them almost useless, couldn’t find a workaround for it yet. Throwing the animation into a group doesn’t help either…

I really wonder why no one mentioned yet that non-uniformly sized sprite sheets can’t be scaled or rotated without messing up the animation :-(( [import]uid: 9644 topic_id: 3814 reply_id: 11698[/import]

Hi guys, and Michael.

After reading Michael’s comment, I decided to try taking my sprite out of the folder and leaving it in the root along with the accompanying .lua data file and suddenly my project builds and works on the device just fine now.

So spritesheets with data work just fine if your file is in the root folder. Seems to be a problem with paths! [import]uid: 11024 topic_id: 3814 reply_id: 11701[/import]

I just submitted a bug against this.
carlos [import]uid: 24 topic_id: 3814 reply_id: 11703[/import]

MauMau, I do not get jitters. But I’ve also spent a lot of time making sure that my sprites are meticulously crafted to ward against this… I can’t offer you any advice, I’m not the artist, but it could just be the source material not being drawn perfectly… again I’m not sure.

To answer your question, I do not get jitters, it’s quite smooth. [import]uid: 7473 topic_id: 3814 reply_id: 11718[/import]

Do you really use NON-uniformly sized frames, desetto?

It has nothing to do with the content of the animation, it’s 100% a technically issue. If you export an animation using Zwoptex (NON-uniformly sized, means: trim option enabled, different sized frames) and display it in Corona, everything seems fine first -as long as you do not scale or rotate the animation. If you do so, the origins of the different frames get messed up, resulting in a different offset for each frame (hence the jittering).

I think this issue is caused by Corona’s way of handling non-uniformed sprite sheets. There’s something wrong with the anchor point (origin) for each frame. Once scaled or rotated, it gets messed up.

In my case, I have an explosion animation. It starts small and gets bigger then. Therefore, the first frames MUST be smaller than the later ones. I could make a uniformly sized animation out of it (no trimming used), but this would be a ridiculous waste of texture space and memory :-/
[import]uid: 9644 topic_id: 3814 reply_id: 11721[/import]