At some points in my game, I would like to cancel all of the transitions that may be happening. I’d like to be able to cancel them all at once, rather than manually canceling each one of them individually. Is there a way to do that? Thanks! [import]uid: 76002 topic_id: 32096 reply_id: 332096[/import]
One method is to create each transition as a table entry - that way you can cancel all transitions in that table with a single function. Here’s one example of how you can do this (though it’s certainly not the only way):
-- CREATE TRANSITION TABLE
local transTable = {}
-- ADD A NEW TRANSITION (in this case to x=100 & y=100):
transTable[#transTable+1] = transition.to(object,{x=100,y=100})
-- CANCEL ALL TRANSITIONS:
for i=#transTable,1,-1 do
transition.cancel(transTable[i])
transTable[i]=nil
end
[import]uid: 27636 topic_id: 32096 reply_id: 127873[/import]
One method is to create each transition as a table entry - that way you can cancel all transitions in that table with a single function. Here’s one example of how you can do this (though it’s certainly not the only way):
-- CREATE TRANSITION TABLE
local transTable = {}
-- ADD A NEW TRANSITION (in this case to x=100 & y=100):
transTable[#transTable+1] = transition.to(object,{x=100,y=100})
-- CANCEL ALL TRANSITIONS:
for i=#transTable,1,-1 do
transition.cancel(transTable[i])
transTable[i]=nil
end
[import]uid: 27636 topic_id: 32096 reply_id: 127873[/import]