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

What is Framer? Join the Community
Return to index
Noam Elbaz
Posted Oct 07 - Read on Facebook

I can't seem to capture Touch position.
I'd like to track user touch movement (x,y) at regular time intervals after Event.TouchStart
Can't get anything to work....
Where do I start? Ideas?
Thanks.

14 Comments

Noam Elbaz

I found Jordan Robert Dobson's Pointer Module which helped a bit. How would I get it to continuously record the (x,y) is the user moves his finger.

Andrew Nalband

Here's the syntax:

layerA.on Events.Click, (event, layer) ->
myTouchEvent = Events.touchEvent(event)

Noam Elbaz

Andrew Nalband I've been using Framer for a while. Learned to code (a bit) through it. And I have know idea what to with this...

Andrew Nalband

Ok, well if you want to share your project and show me exactly what you're trying to achieve I'll walk you through it.

Noam Elbaz

Andrew Nalband There nothing really to see just yet... I just want to capture the position of the touch event throughout the duration of the touch move many times so I can get a rough track of the gesture

Andrew Nalband
Andrew Nalband

Here's the code - hey Koen Bok - can we get an update to the docs that uses this example for the touch events? This is the second time I've answered this question today! :)

bg.on Events.TouchMove, (event, layer) ->
touchX = Events.touchEvent(event).clientX
touchY = Events.touchEvent(event).clientY

Noam Elbaz

Andrew Nalband thanks. awesome. This code is kinda different than what I'm used to in Framer. I guess - every time the X or Y gets updated myTouchEvent gets updated.

Erik Edhagen

Everytime a TouchMove event is triggered (that is, the user moves their finger), touchX and touchY is updated with the X and Y position. In the code above, you can remove the myTouchEvent line since it does nothing.

Andrew Nalband

Oops, forgot to take that out!

Jordan Robert Dobson

Guys my pointer module will make this a lot more sane from desktop to touch.

Andrew Nalband

Jordan Robert Dobson Koen Bok Benjamin Den Boer - any ideas on how we can make this stuff easier for people? Framerco.de definitely helps, but it seems like there should be an easy way to browse, understand and import different modules. There are lots of useful ones out there, but searching in the facebook group, trying to get your head around the purpose of a module and then actually knowing how to implement this stuff is a rather fragmented and difficult process. Most stuff is pretty spotty on documentation (understandably), and there's no real social proof or voting mechanism for determining what the "good" ones are.

Erik Edhagen

By the way, reading this thread keeps putting this song in my mind: https://www.youtube.com/watch?v=AV4smtJrIOM. You're welcome!

Noam Elbaz

Thanks for all the input.

Read the entire post on Facebook