[FREE DL] Complicated drag and drop example - works on all tablets


(Lucky) #1

Hey guys,
Sorry for not adding any contributions recently. Thought I’d make it up with a super complicated build I did for a client recently.

It’s a drag and drop ad with GSAP and Hype.

See it working

It’s got multiple selections with multiple scenes linked. It works on all devices I need it to work on(tablets :P)
In making it I tried to use document.getelementfrompoint but i found on androids it goes super buggy so i found its best to avoid it and just use event.target.

Now the drag and drop always goes to the target e.g.

But you know there’s bound to be some offset differences , so i couldn’t make a perfect x y destination with this many clothes so they all had to have individual x y destinations. Instead of having a massive x y array i put it in the attributes.

So i could nudge it in there. The initial x and y I didn’t need to specify ,as on the scene load it runs a for loop and sets them up based on where they were on load.

But yeah if anyone wants to do something more advanced with drag and drop take a look at this.

index_v7.zip (1.2 MB)


(Freelancer) #2

@Luckyde
absolutely fantastic! Nice graphics and clean code.


(Kuswanto) #3

Thank you for sharing, very good interaction and this should me help for my next project :slight_smile: