Drag and drop - Only correct if rectangle (drop item) is within the borders of other Rectangle (drop zone)

Feb 14, 2022

I am in the process of creating a drag and drop exercise. The exercise is the drag item, a rectangle (grouped with some other shapes), should only be correct if it is completely inside the drop zone, also a rectangle. Now the drop is already correct if the borders intersect with each other. I also don't want there to be an automatic snap to the center.

Does anyone have a clue how I can solve this?

2 Replies
Paul Maenen

Hi Phil.

The snapping was clear for me. I just wanted to tell that snapping was not an option for me to solve the problem ;-) .... 

But I've got some good news! I solved the problem. What I did is:

- I created a frame shape. 
- Then I shaped the inside of the frame around the area that should be the correct drop zone
- Then I changed the slide to free form - drag and drop
- I selected the frame shape as the correct drop zone
- Created a custom submit button and the correct and incorrect layers were created automatically
- Then I changed the information in both layers. So visually the correct layer shows "this answer is incorrect" and the incorrect layer shows "this answer is correct"
- The last step is to change the targets of the triggers of the button on the correct and incorrect layer. The trigger on the correct layer should lead to the start of the base slide and the trigger on the incorrect layer should lead to the next slide.

This works perfectly!

It's also possible for step 1 and 2 in my explanation to use multiple other shapes to isolate the correct drop zone and group them instead of using the frame shape. Then you are more flexible in shaping the shapes around the area that should be the correct drop zone.

Hopefully my explanation is clear :-)