Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/britzl/extension-filedrop

This extension provides a unified, simple to use interface to handle drag and drop of files onto a Defold application
https://github.com/britzl/extension-filedrop

Last synced: 4 months ago
JSON representation

This extension provides a unified, simple to use interface to handle drag and drop of files onto a Defold application

Awesome Lists containing this project

README

        

## FileDrop API for Defold
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:

* HTML5 through the [Drag And Drop API](https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/File_drag_and_drop)
* macOS

## Usage
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](https://github.com/britzl/extension-filedrop/releases).

## Example

```lua
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
```