Drag and drop files/pictures onto a love2d window?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
xThomas
Prole
Posts: 16
Joined: Tue May 02, 2017 2:43 am

Drag and drop files/pictures onto a love2d window?

Post by xThomas »

lets say for the sake of argument, the user would drag and drop a picture, or video, or text file onto a love2d window. like how in imgur or many other programs you can drag and drop files/pictures. same thing here

Possible?
User avatar
Link
Prole
Posts: 19
Joined: Tue Jun 19, 2018 4:09 am

Re: Drag and drop files/pictures onto a love2d window?

Post by Link »

I've not used it personally (I'm using an older version), but since Love 0.10.0 there are 2 new callback functions for this functionality:

https://www.love2d.org/wiki/love.filedropped
https://www.love2d.org/wiki/love.directorydropped
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Drag and drop files/pictures onto a love2d window?

Post by zorg »

I can attest to it, those two functions do indeed work. Tested on Windows, at least.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
pgimeno
Party member
Posts: 3674
Joined: Sun Oct 18, 2015 2:58 pm

Re: Drag and drop files/pictures onto a love2d window?

Post by pgimeno »

Works on Linux as well. Here's a project that relies on drag-and-drop of a video: viewtopic.php?t=82429

It happens to work unmodified in 11.1.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 11 guests