How do I limit the dragging of an object?

Get help using Construct 2

Post » Wed Mar 30, 2016 10:21 pm

I want to limit the dragging of an object to a certain amount of pixel like you can't drag and drop an object for more than 100 pixel. how would you do that?
B
14
S
6
Posts: 56
Reputation: 1,212

Post » Mon Apr 04, 2016 3:17 pm

On Click: Store the current X/Y
then every tick calculate the distance between x2,y2 and the original X,Y (using pythagorean theorem).
if c > 100, stop dragging
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,415
Reputation: 4,824


Return to How do I....?

Who is online

Users browsing this forum: Fradno, StarrodKirby2, ultrafop and 9 guests