I use object:translate( deltaX, deltaY ) to move my obj, but when touch, I need change the move for other position, how I stop translate??
links:
object:translate = http://docs.coronalabs.com/api/type/DisplayObject/translate.html
I use object:translate( deltaX, deltaY ) to move my obj, but when touch, I need change the move for other position, how I stop translate??
links:
object:translate = http://docs.coronalabs.com/api/type/DisplayObject/translate.html
You should use the Corona transition library instead.
http://docs.coronalabs.com/api/library/transition/index.html
Save the transition in an object variable.
object.transition = transition.to(object, {x = xValue, y = yValue, delta = true})
Then you can cancel the transition with:
if object.transition then transition.cancel(object.transition) object.transition = nil end
Hope that helps.
You should use the Corona transition library instead.
http://docs.coronalabs.com/api/library/transition/index.html
Save the transition in an object variable.
object.transition = transition.to(object, {x = xValue, y = yValue, delta = true})
Then you can cancel the transition with:
if object.transition then transition.cancel(object.transition) object.transition = nil end
Hope that helps.