the mouse to drag and drop items

Get help using Construct 2

Post » Sun May 26, 2013 4:03 am

Help please! I want to do whatever thing you can drag and drop, as for example in diablo2.
B
15
S
6
G
1
Posts: 46
Reputation: 2,753

Post » Sun May 26, 2013 8:47 am

You can use an invisible sprite that is set to the Mouse.X and Mouse.Y coordinates. This will allow it to follow the mouse cursor. You assign the pin behavior to the objects you want to be able to click and drag on. Then you set a condition that when the mouse button is clicked/held down, if the invisible sprite is over a dragable object that you pin the object to your invisible mouse sprite. When they let off the mouse button you set the dragged objects x/y coordinates to the mouse x/y and unpin it. (unpin it then set it's X and Y actually)
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Sun May 26, 2013 9:43 am

Thank you! I will try.
B
15
S
6
G
1
Posts: 46
Reputation: 2,753

Post » Sun May 26, 2013 9:51 am

Can't you assign a "Drag and Drop" behaviour to the sprites or familiy you want to drag and drop? If you go to the Sprite or Familiy's proprties you can add a behavior for dragging and dropping.
B
10
S
2
Posts: 94
Reputation: 1,536

Post » Sun May 26, 2013 8:20 pm

Yes, thank you! It's simple!
B
15
S
6
G
1
Posts: 46
Reputation: 2,753


Return to How do I....?

Who is online

Users browsing this forum: MarkThomas and 17 guests