on 294fdfd help sign in
elk/libraries/Touch.elm
18 lines 733 B history raw
1-- This is an early version of the touch library. It will likely grow to
2-- include gestures that would be useful for both games and web-pages.
3module Touch where
5import Native.Touch as T
7type Touch = { x:Int, y:Int, id:Int, x0:Int, y0:Int, t0:Time }
9-- A list of touches. Each ongoing touch is represented by a set of
10-- coordinates and an identifier id that allows you to distinguish
11-- between different touches. Each touch also contains the coordinates and
12-- time of the initial contact (x0, y0, and t0) which helps compute more
13-- complicated gestures.
14touches : Signal [Touch]
16-- The last position that was tapped. Default value is `{x=0,y=0}`.
17-- Updates whenever the user taps the screen.
18taps : Signal { x:Int, y:Int }