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

What is Framer? Join the Community
Return to index
Keith Lang
Posted Jul 30 - Read on Facebook

In Framer Studio the following code is working (letting me draw stuff on Canvas at the mouse Position), yet on iPhone it's producing 'underfined' for myX and myY. Any ideas?

myCanvasView.on Events.TouchMove, (event, layer) ->
myTouchEvent = Events.touchEvent(event)
myX = myTouchEvent.x
myY = myTouchEvent.y

3 Comments

Keith Lang

OK I solved it—seems I need a slightly different way to access the touches directly on the phone.

myCanvasView.on Events.TouchMove, (event, layer) ->
myTouchEvent = Events.touchEvent(event)
if (Utils.isPhone())
myX = event.touches[0].screenX
myY = event.touches[0].screenY
else
myX = myTouchEvent.x
myY = myTouchEvent.y

Keith Lang

I want to add that I only solved this due to the quick try-and-see nature of Framer. I had a to Google for some time to find reference to this other method, and there was a lot of trying permutations, but because no compile/share cycle I wasn't discouraged past the threshold of stopping trying. So, kudos to the Framer Studio team. The realtime nature of the desktop app, including using Frameless on my iPhone make a really big difference and your team's work is very appreciated

Keith Lang

Oh, and the console implementation on both desktop and iPhone are super nice, and saved the day.

Read the entire post on Facebook