Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/britzl/extension-filedrop
- Owner: britzl
- License: mit
- Created: 2021-04-14T21:51:38.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-11T08:01:48.000Z (10 months ago)
- Last Synced: 2024-04-11T09:36:21.922Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-defold - FileDrop
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
```