Sprite Sheet Error

bad argument #2 to 'newImageSheet' (for single frame size, 'options' table must contain valid 'width' and 'height' values)

Here’s the code in my scene create:

 

 --||||||||||||||||Enemy PlaceHolder||||||||||||||||||||||| --||||||||||||||| Eagle |||||||||||||||||||||||||| local sheetOptions6 ={width = 1278,height = 929,numFrames = 8} local sheet\_idleBird2 = graphics.newImageSheet( "eagle.png", sheetOptions6) local sequences\_idleBird2 = {{name="normalFly",start=1,count=8,time=2200,loopCount=0}} enemyBoss = display.newSprite(sheet\_idleBird2, sequences\_idleBird2) enemyBoss.x = \_W + 200; enemyBoss.y = -200; enemyBoss.soundPlayed = false; enemyBoss:scale(-0.2,0.2); enemyBoss.myName = "bossChase"

Any help would be appreciated :slight_smile:

Is your image sheet definitely those dimensions?

Yes. Well each frame is 1278x929. 8 frames. Am i missing something?

So what are the dimensions of eagle.png?

Eagle is 1278 x 7432

Thats a huge sheet!  Did you see gotchas in the docs? https://docs.coronalabs.com/api/library/graphics/newImageSheet.html

Ah! That might explain it! So i need to resize it down to something more manageable!!! I’ll get to work on it asap. Thanks for the tip.

Ha!  No problem.  This is well worth a purchase if you’re doing a lot of work with sprite sheets -> https://www.codeandweb.com/texturepacker

This worked like a charm. I also resized all the other imagesheets also and the app works now on my phone.  Only problem now is getting the Ads to show up. But that’s another Thread hah. 

Thanks Phil!

Is your image sheet definitely those dimensions?

Yes. Well each frame is 1278x929. 8 frames. Am i missing something?

So what are the dimensions of eagle.png?

Eagle is 1278 x 7432

Thats a huge sheet!  Did you see gotchas in the docs? https://docs.coronalabs.com/api/library/graphics/newImageSheet.html

Ah! That might explain it! So i need to resize it down to something more manageable!!! I’ll get to work on it asap. Thanks for the tip.

Ha!  No problem.  This is well worth a purchase if you’re doing a lot of work with sprite sheets -> https://www.codeandweb.com/texturepacker

This worked like a charm. I also resized all the other imagesheets also and the app works now on my phone.  Only problem now is getting the Ads to show up. But that’s another Thread hah. 

Thanks Phil!