Click to move an object (Drag & Drop behaviour)

Get help using Construct 2

Post » Thu Mar 01, 2012 1:19 pm

Hello. I would like so that instead of having to hold down the mouse to move and object, you click once to be able to move it, and click again to drop it. Would it be possible to add this option in the official Drag & Drop behaviour someday?
B
63
S
23
G
17
Posts: 254
Reputation: 14,342

Post » Thu Mar 01, 2012 4:00 pm

You could add a boolean instance variable to the object, name it something like "IsSelected"

on mouse click over object
then > toggle "IsSelected"

if 'IsSelected' = True
then > position object to mouse coordinates

You may have to add other events to stop you being able to select more than one object at a time... hope that helps
B
28
S
8
G
1
Posts: 469
Reputation: 4,683


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests