This extension provides a unified, simple to use interface to handle drag and drop of files onto a Defold application. The extension supports the following platforms:
To use this library in your Defold project, add the following URL to your game.project
dependencies:
https://github.com/britzl/extension-filedrop/archive/master.zip
It is recommended to use a link to the zip file of a specific release.
function init(self)
filedrop.set_listener(function(self, event, filename, data)
if event == "dragover" then
print("Drag over")
elseif event == "dragleave" then
print("Drag leave")
elseif event == "drop" then
print("Dropped ", filename, data)
end
end
end