Sprite Animation Crash On iPhone 6 (Works fine in simulator)

Here is a screen of my error on the iPhone6

The sheets resolution is 7200x5120

10 frames wide and 4 frames tall
There is 0 pixels between each frame so I am using the dimensions of 720x1280 for the sequence table.

Anything wrong with those numbers in regards to my error?

I will try renaming the files.
I am currently on iOS 8.

Also, my config.lua file looks like this.

Would these settings be screwing up the way the images are read?

[lua] 

content =

{

width = 320,

height = 480, 

scale = “zoomEven”,

fps = 30,

}

[/lua]

m4…

I think the limit on newer devices for a texture size is 4096x4096 (I don’t keep up on that stuff, so I am not sure, but I am pretty sure)… but in any case, I never have a sprite sheet or image(at least yet) that is bigger then 1024 x 1024 … but i might have one that is 2048x2048(that is the biggest I would ever go) …   So that size of 7200 x whatever is too big.  Can’t see a need for something that big made of 40 frames. In any case, that adds up to a lot of texture memory.

See if you can work with those frames in smaller sizes, and be able to make that large image sheet much much smaller. 

But, the error you are getting, may not be directly due to the size of the image.    Just not likely you are going to be able (nor should you) use an image that size.

Check your ‘options’ table you coded for the image sheet.  What do you have for the ‘sheetContentWidth’ and ‘sheetContentHeight’.  According to this error message,  they are set at  4096, 2912 … and if your ‘width’ and ‘height’ fields in the ‘options’ table 720, 1280  then the frame chunks are too large to equal out to 40 frames in that smaller space of  4096, 2912.  That is normally the cause of that particular error message.  It is easy to happen, if you typo a number wrong, or change one of those 4 fields and they all do not coordinate together.

As to why that never error when on the simulator, I can only guess, you changed just one of those dimensions by accident or otherwise  before you went from simulator to device. 

To test:

make a copy of that super large image sheet (just to keep a backup of your original art, in case something happens)…  scale down the copy width to 2048 or 4096 at the most.  See that the height scales down proportionally, so your frames do not distort or stretch.  

After the scaling, you may have to adjust the height by 1 pixel or so, to make sure the height is evenly divisible by 4… as you have 4 rows.  Use this new scaled down image sheet in your code.

Redo your code for the image sheet, changing the 5 important fields in the ‘options’ table.   width, height, frames, sheetContentWidth, sheetContentHeight …  I think it will work.  Just for fun then, double that image size(scale it to 4096 x 4096) and double all those 5 fields except the ‘frames’  they stay at 40 since that is what you set.   See how works when the image is at 4096.

It should work as long as you keep those 5 fields in co-ordination.   

If you have more errors, please post your line of code where you create your ‘options table’, and your ‘newImageSheet’.

I hope this helps.

Bob

m4…

I did notice you did not put in the ‘sheetContentWidth’ and ‘sheetContentHeight’ in options table; which is acceptable as those fields are optional, according to corona documentation. I always put them in my options table. 

I can guess, since you did not enter the ‘sheetContentWidth’ corona defaults it to the max of 4096… and again, since your frame ‘width and height’ values are too large for that 4096 amount you get that error it could only make 11 of the 40 frames.

Good luck.

Bob

7200x5120 is too big.  

For best compatibility (Android and iOS), limit sheets to 2048x2048.  

If you are only targeting iOS, 4096x4096 should be your max.  

8192x8192 is the limit on the high-end devices (and your PC/Mac most likely), but that is way too big for old devices.

Thank you both for your replies. I will test this out very soon and get back to you.
I appreciate the help!