Need example code for grab and drop object with mouse?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
012rev3
Prole
Posts: 3
Joined: Wed Aug 09, 2017 9:41 am

Need example code for grab and drop object with mouse?

Post by 012rev3 »

Hi guys!
I need example code for the mouse selection object. Can i do it and how?
I already searched but didn't found or i cant do it sory :(
Need to grab object with mouse and drop it where i want to...
Xugro
Party member
Posts: 114
Joined: Wed Sep 29, 2010 8:14 pm

Re: Need example code for grab and drop object with mouse?

Post by Xugro »

You can look at the code of my video puzzle:
https://love2d.org/forums/viewtopic.php ... 9&p=207465
012rev3
Prole
Posts: 3
Joined: Wed Aug 09, 2017 9:41 am

Re: Need example code for grab and drop object with mouse?

Post by 012rev3 »

No no sory for my english.
I mean grab object in the window screen and drop it. Example box object. I want select and grab box object with mouse in the window and change object location.

Look it please : https://jqueryui.com/droppable/
Xugro
Party member
Posts: 114
Joined: Wed Sep 29, 2010 8:14 pm

Re: Need example code for grab and drop object with mouse?

Post by Xugro »

Here is an example code that does the same thing as your Javascript example. :)
Attachments
droppable.love
(621 Bytes) Downloaded 203 times
012rev3
Prole
Posts: 3
Joined: Wed Aug 09, 2017 9:41 am

Re: Need example code for grab and drop object with mouse?

Post by 012rev3 »

Yes! Thank you so much. :)
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests