Hi. Could somebody save my sanity please?
I am attempting a very simple sprite animation and would like the sprite to change from one sequence to another.
I am using setSequence to no effect. As below . . .
First sequence runs fine. Print statements confirm the sequence has not changed
[lua]
print “*************** HERE1 **************************”
local tmp
local boatInfo = require “ch2CH”
local boatSheet = graphics.newImageSheet(“ch2CH.png”, boatInfo:getSheet() )
local boatSeqData
boatSeqData =
{
{name = “setsail”, frames = {3,8}, time = 200, loopCount = 2, loopDirection = “forward”},
},
{
{name = “setsail2”, frames = {1 ,2, 3 ,4,5,6,7,8 }, time = 600}
}
– Create sprite
tmp = display.newSprite( boatSheet, boatSeqData )
tmp.x = display.contentCenterX
tmp.y = display.contentCenterY
tmp:setSequence( “setsail” )
tmp:play()
print(“XXX1” … tostring(tmp.sequence))
tmp:setSequence( “setsail2” )
print(“XXX2” … tostring(tmp.sequence))
tmp:play()
print “*************** HERE2 **************************”
[/lua]