Hi guys
Just wondering how I would go about Tweening my sprite by lets say 100 pixels.
I know how to tween to a certain co-ordinate (e.g: y=345), but can’t seem to figure out how to tween by a certain number of pixels 
Thank you in advance!
Hi guys
Just wondering how I would go about Tweening my sprite by lets say 100 pixels.
I know how to tween to a certain co-ordinate (e.g: y=345), but can’t seem to figure out how to tween by a certain number of pixels 
Thank you in advance!
Hey,
You’d basically need to just add or subtract the amount from the current coords of your object. So, something like this:
local moveByX = 10 – can be whatever you want
local moveByY = 10 – ditto
local myTween = transition.to( obj, {time=10, x=obj.x + moveByX, y=obj.y + moveByY})
Hope this helps
Rich
Thanks heaps! I knew it had to be something simple 
I should have thought of that!
Thanks again
No problem buddy 
Rich
Actually, there is a second solution:
transition.to( obj, { delta=true, x=moveByX, y=moveByY }
Setting delta = true means that any object value you give (x,y, alpha, and so on) is an adjustment to its existing value. So you could say -10 to move left, or 10 to move right.
wow, I didn’t even know that
that’s an excellent solution. Thanks for sharing!
Hey,
You’d basically need to just add or subtract the amount from the current coords of your object. So, something like this:
local moveByX = 10 – can be whatever you want
local moveByY = 10 – ditto
local myTween = transition.to( obj, {time=10, x=obj.x + moveByX, y=obj.y + moveByY})
Hope this helps
Rich
Thanks heaps! I knew it had to be something simple 
I should have thought of that!
Thanks again
No problem buddy 
Rich
Actually, there is a second solution:
transition.to( obj, { delta=true, x=moveByX, y=moveByY }
Setting delta = true means that any object value you give (x,y, alpha, and so on) is an adjustment to its existing value. So you could say -10 to move left, or 10 to move right.
wow, I didn’t even know that
that’s an excellent solution. Thanks for sharing!