Created
April 29, 2016 09:30
-
-
Save medecau/22cec5853a5f7285ee2f97363bca096c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_library('Drop') | |
from drop import SDrop, DropListener | |
drop = None | |
img = None | |
class DropyListener(DropListener): | |
def dropEvent(self, e): | |
global img | |
if e.isImage(): | |
img = e.loadImage() | |
def setup(): | |
size(500, 500) | |
drop = SDrop(this) | |
drop.addDropListener(DropyListener()) | |
def draw(): | |
background(31) | |
if img: | |
image(img, 0, 0) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment