private PImage image;
DragDropFrame(URL background, URL dragTarget) throws IOException {
final PCanvas canvas = new PCanvas();
image = new PImage();
BufferedImage backgroundImage = ImageIO.read(background);
PImage backgroundNode = new PImage();
backgroundNode.setImage(backgroundImage);
//backgroundNode.setPickable(false);
//canvas.get
BufferedImage dragTargetImage = ImageIO.read(dragTarget);
PImage dragTargetNode = new PImage();
dragTargetNode.setPickable(true);
dragTargetNode.setOffset(10,10);
dragTargetNode.setImage(dragTargetImage);
canvas.getLayer().addChild(backgroundNode);
canvas.getLayer().addChild(dragTargetNode);
add(canvas);
dragTargetNode.addInputEventListener(new PDragEventHandler(){
@Override
protected void startDrag(PInputEvent event) {
// System.out.println("Start dragging");
}
});
dragTargetNode.addInputEventListener(new PBasicInputEventHandler(){
@Override
public void keyTyped(PInputEvent event) {
super.keyTyped(event);