Hi All,Need your help urgently...How to drag image object back automatically to Origin?

Hi All,

I am developing English Sound Finder Game for Pre_School kids.Please have a look the following image.

When the kid drag and drop “b” image to Box,the “Correct” Sound will come out and if the kid drag and drop the others english alphabet to Box,the “Wrong” Sound will come out and the wrong alphabet image need to drag back to their origin automatically.May I know is it possible to do that?

Best Regards,

John

Well you won’t “drag” it back, but you can “transition” it back.  When you create the object and set it’s X and Y, save a copy of it’s X and Y

letterP = display.newImageRect(“letterP.png”, 30, 60)  – (or whatever size it is)

letterP.x = 200

letterP.y = 100

letterP.xOrig = 200

letterP.yOrig = 100

Then when they drop the wrong letter do:

transition.to(letterP, {time=500, x=letterP.xOrig, y=letterP.yOrig})

or something like that.

Well you won’t “drag” it back, but you can “transition” it back.  When you create the object and set it’s X and Y, save a copy of it’s X and Y

letterP = display.newImageRect(“letterP.png”, 30, 60)  – (or whatever size it is)

letterP.x = 200

letterP.y = 100

letterP.xOrig = 200

letterP.yOrig = 100

Then when they drop the wrong letter do:

transition.to(letterP, {time=500, x=letterP.xOrig, y=letterP.yOrig})

or something like that.