2014-04-09 7 views
0

간단한 질문이지만 그것을 이해할 수 없습니다. 함수에서 Corona SDK의 transition.to 업데이트

나는이 있습니다

transition.to(object, { time=300, alpha=1, tag= "moveObject", x=500, y=50, onComplete= end }) 

나는 그것이 "살아"아직 때 내가 전환을 업데이트하는 데 사용하려는 기능을 가지고있다.

Function updateObject(tagname) 
--update the transition.to x with +50 

End 

어떻게 함수에서 전환을 업데이트 할 수 있습니까?

답변

0

전환을 취소하고 새 전환을 만들어야합니다. 취소하려면 저장해야합니다. 예 :

local toX = 500 
local yourTrans = transition.to(object, {x=toX, ... }) 

... 

function updateObject(tagname) 
    --update the transition.to x with +50 
    transition.cancel(yourTrans) 
    toX = toX + 50 
    yourTrans = transition.to(object, {x=toX, ... }) 
end 
관련 문제