Limit the drag-and-drop behaviour to axis

Get help using Construct 2

Post » Mon Nov 05, 2012 8:03 pm

Hi guys, I was wondering if anyone had a good idea how to limit the drag and drop feature to an axis, so the object would only be able to be dragged up and down for example, like a zip!

I've thought about using the clamp expression, and had confusing and glitchy results! Does anyone have a better idea?

Cheers!Mr E Bear2012-11-05 20:09:52
B
49
S
14
G
3
Posts: 540
Reputation: 5,611

Post » Mon Nov 05, 2012 8:28 pm

Why not just make your own drag and drop with events..?

+on mouse clicked on object
     >set object.drag to 1

+if object.drag = 1
     >set object.Y to mouse.y

+on mouse left click released
     >set object.drag to 0
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Mon Nov 05, 2012 8:50 pm

Cheers for the suggestion! Took your idea and run with it, removed the flags by just having the movement event activate on IsTouching :)
B
49
S
14
G
3
Posts: 540
Reputation: 5,611


Return to How do I....?

Who is online

Users browsing this forum: Axiomaltd, jeffige and 27 guests