instantiating spriteSheetFromData() crashes the device?

Hello!

First of all, I am fresh landed to Corona from the Flash World :slight_smile: Been working with corona for about 6 days now and I almost got a game prototype ready, wich is AWESOME!!

So a BIG thank you for your awesome work!!

However, before purchasing I just went to test misc things and run into some nasty issue:

I got a sprite exported with TexturePacker and is basically just a circle growing from 10% to 100% and then back to 10%…

Everything goes well in the simulator but when testing on the device (iPhone4) the script just adds the bgImage and then freezes and does nothing.

Here is the script:


local sprite = require(‘sprite’)

local test = require(‘assets/sprites/HitCircle’)
local spriteData = test.getSpriteSheetData()
local spriteSheet = sprite.newSpriteSheetFromData(‘assets/sprites/HitCircle.png’, spriteData)
local spriteSheetSet = sprite.newSpriteSet(spriteSheet, 1, 35)

sprite.add(spriteSheetSet, “circleLoop”, 1, 35, 1000, 1)

local circleSpriteAnim = sprite.newSprite(spriteSheetSet)

circleSpriteAnim:prepare( “circleLoop” )
circleSpriteAnim:play()

But my question is how come everything goes well in the simulator?
Any advice? Is there anyway to debug the app while on device? I allways work with the Corona Terminal Window opened.

Thank you! [import]uid: 125690 topic_id: 21957 reply_id: 321957[/import]

Hey, got it working :slight_smile:

I was not aware that for spritesheet animation, the actual spritesheets needed to be in the same folder as in the main.lua file :slight_smile:

the confusing part was that it was all good on simulator!

thank you and (please) keep up the awesome work!! [import]uid: 125690 topic_id: 21957 reply_id: 87321[/import]

Well done on figuring this out - sorry no one was here to help you earlier, although it seems like you solved it pretty quickly :wink:

Good luck with your project :slight_smile:

PS - Glad to hear you always have the terminal open; it is one of those things that some people get into bad habits with and then it can be a real pain down the line. [import]uid: 52491 topic_id: 21957 reply_id: 87441[/import]