Changing DragDrop Button

Get help using Construct 2

Post » Tue Apr 23, 2013 3:53 am

I'm afraid I already know the answer to this question, but I thought I'd ask just in case.

Is it possible to change the button that triggers the DragDrop behavior? I've scoured the mouse, system, and behavior events (not to mention the forums), but I can't find a thing.

I know it's possible to piece together your own drag-and-drop functions without the behavior, but I'd hate to have to go through all the trouble if I didn't have to.

B
15
S
4
G
1
Posts: 168
Reputation: 2,177

Post » Tue Apr 23, 2013 4:20 am

Doesnt look like it, but that being said I thought I would save you some trouble.

Try this.

http://db.tt/2YDbSy3w
ImageImage
B
74
S
17
G
6
Posts: 1,039
Reputation: 10,605

Post » Tue Apr 23, 2013 4:54 am

Thanks for the quick response, Genki! That's what I love about you guys in the community! That, and your snappy fashion sense.

That's actually what I have running right now. The only problem with it right now is when gripping smaller objects, and sometimes the larger ones, the player will lose control of the object if they move the mouse too fast. (Though, I think it might be a problem with where I placed the origin points)

Eventually, I want to add the ability to pick up and throw objects, and moving the mouse quick enough to throw objects far enough might be a problem.
B
15
S
4
G
1
Posts: 168
Reputation: 2,177

Post » Tue Apr 23, 2013 5:17 am

Haha no worries, thanks for the laugh :)

I see what you mean with the prev example, here is something a little more robust. Instead of making sure the cursor is over the object we are moving, we can set a variable to turn on and set the position of the object based off that.

http://db.tt/xFkRF5PCGenkiGenga2013-04-23 05:18:23
ImageImage
B
74
S
17
G
6
Posts: 1,039
Reputation: 10,605

Post » Tue Apr 23, 2013 7:12 am

That did the trick! Runs pretty smooth. Thanks again. I probably would've snapped my desk in half with my forehead without your help.

Now all I need to do is measure mouse velocity, and people will be hurling boxes at each other like champs!
B
15
S
4
G
1
Posts: 168
Reputation: 2,177


Return to How do I....?

Who is online

Users browsing this forum: chcteacher, mnmco, Televangelist and 28 guests