Reacting to files being dragged over the game window.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Reacting to files being dragged over the game window.
I guess you'll have to use LuaFFI, and find which function is used in the Windows API.
I found this.
May the force be with you.
I found this.
May the force be with you.
- slime
- Solid Snayke
- Posts: 3160
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Reacting to files being dragged over the game window.
LÖVE [wiki]0.10.0[/wiki] will have APIs for this, but 0.9 doesn't.
Re: Reacting to files being dragged over the game window.
I'm not too familiar with how FFI works, so I'd rather wait until the next version. Thanks.
Re: Reacting to files being dragged over the game window.
slime wrote:LÖVE [wiki]0.10.0[/wiki] will have APIs for this, but 0.9 doesn't.
Have you seen how FLTK handles this? There's only one event for the actual dropping (same as the normal paste event) but there are special dnd events that fire first (enter, leave, drag, release) so you can give user visual feedback. Just thought you might be interested to see how they've done it, it works pretty nicely.Added love.filedropped and love.directorydropped event callback functions.
Re: Reacting to files being dragged over the game window.
I would vouch for something a little more like this, maybe have love.datadragged(x, y, data) and love.datadropped(x, y, data).time thief wrote: Have you seen how FLTK handles this? There's only one event for the actual dropping (same as the normal paste event) but there are special dnd events that fire first (enter, leave, drag, release) so you can give user visual feedback. Just thought you might be interested to see how they've done it, it works pretty nicely.
The return value of datadragged could be used to tell the OS whether dropping is possible.
- slime
- Solid Snayke
- Posts: 3160
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Reacting to files being dragged over the game window.
LÖVE relies on SDL for dropped-file events, and SDL's APIs for that are pretty basic right now (even more basic than love.filedropped and love.directorydropped, in fact.)
On OS X you can specify which file types are supported by modifying the LÖVE Info.plist file (although you should only do that for fused games.)
On OS X you can specify which file types are supported by modifying the LÖVE Info.plist file (although you should only do that for fused games.)
Who is online
Users browsing this forum: Bing [Bot] and 4 guests