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