Page 1 of 1

Limit drag to another sprites image area

PostPosted: Thu May 10, 2012 9:16 pm
by Escualo
Hej there :-)
I am using drag and drop behavior and i want to drag a small circle that is within a big circle.
I want to make it so the small circle can not come out of the big circle´s image, even though the small circle its still being dragged. I this possible whit drag and drop Behavior?

Hope it makes sense :-)

Re: Limit drag to another sprites image area

PostPosted: Thu May 10, 2012 9:36 pm
by Xavier
How about if you add the condition:

if smallcircle is overlapping bigcircle


Re: Limit drag to another sprites image area

PostPosted: Fri May 11, 2012 6:54 am
by Escualo
Thanks for the quick anwser :)
I have tried that and i can only get it to stop draggin when is not overlapping
What want is
Cuntinue dragging it, but the small circle should be trapped inside the big circle.


Re: Limit drag to another sprites image area

PostPosted: Fri May 11, 2012 2:08 pm
by Yann
in this particular situation you just want a distance constraint
distanceConstraint.capx
The green circle is drag&droppable

Re: Limit drag to another sprites image area

PostPosted: Mon May 14, 2012 5:37 pm
by Escualo
Thaks so much for the file :-D thats exactly what i was aiming for.

After a lot of work i could first check it today.
Made my dag :-)