I’m new to Corona and Lua and I’m considering rewriting an iOS app I wrote.
I have some code that works that loads a simple animation:
local sheetData = { width=270, height=250, numFrames=12, sheetContentWidth=540, sheetContentHeight=1500 } local mySheet = graphics.newImageSheet( "radar.png", sheetData ) local sequenceData = { { name = "normalRun", start=1, count=12, time=800, loopCount=1 }, } local animation = display.newSprite( mySheet, sequenceData )
Can I now go back and alter the sequenceData variables? For example, maybe I want loopCount to be 2 based on a preference for the app.
I tried this and I can see in the terminal that the value changed, but it did not cause the animation to loop twice:
sequenceData[1].loopCount=2 print ("Value="..sequenceData[1].loopCount)
I’m sure it’s something simple. Can anyone point me in the right direction?