This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Chris Wang
Posted May 25 - Read on Facebook

Hey guys, if I want to prototype something like the pinterest long press, how do I detect if a touch moves into/out of a layer?

Are there equivalent of MouseOver, MouseOut for touch events?

4 Comments

Jordan Robert Dobson

You capture the touch on a proxy layer and detect if the touch X & Y is within the bounds of the circle.

This is not a simple task btw. Took me roughly 2-3 weeks step by step to get this working in a solid way. I also left a lot of details out for building in Obj-c.

Step one. Have a dummy layer size of screen.

Step two. On press and hold check if the first point and every point in move event exists inside a circle on the screen. There are scripts out there for this.

Step three start randomly placing the circles based in long press position. (Handle a shit ton of edge cases)...

Ps I can't share my code but can offer help if you have specific questions.

Jordan Robert Dobson

That said I believe there are some helpers now to do some of this easier in Framers Utils class that aren't in the documentation. Check the source on github in Utils.coffee

Chris Wang

Thank you so much Jordan. Right now I'm just using the Mouse events for my prototype, it's a hack and only works in framer studio. I will search for those resources.

Jordan Robert Dobson

You can also use touch events instead of mouse. Same difference basically.

Read the entire post on Facebook