on master help sign in
Convert Touch docs.
commitea131c9771937b42bb5efef2b95b66d1595d388d authorJustin Leitgeb <justin@stackbuilders.com> dateTue 10 Sep 2013, 12:10 (13 years ago) parentc69ff2a
1 file changed+23−12
libraries/Touch.elm+23−12
libraries/Touch.elm+23−12
@@ -1,24 +1,35 @@
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.
31module Touch where
42
3+{-| This is an early version of the touch library. It will likely grow to
4+include gestures that would be useful for both games and web-pages.
5+
6+# Touches
7+@docs touches
8+
9+# Gestures
10+@docs taps
11+-}
12+
513import Signal (Signal)
614import Native.Touch
715import Time (Time)
816
9−-- Every `Touch` has `xy` coordinates. It also has an identifier `id` to
10−-- distinguish one touch from another.
11−--
12−-- A touch also keeps info about the intial point and time of contact:
13−-- `x0`, `y0`, and `t0`. This helps compute more complicated gestures
14−-- like taps, drags, and swipes which need to know about timing or direction.
17+{-|
18+Every `Touch` has `xy` coordinates. It also has an identifier `id` to
19+distinguish one touch from another.
20+
21+A touch also keeps info about the initial point and time of contact:
22+`x0`, `y0`, and `t0`. This helps compute more complicated gestures
23+like taps, drags, and swipes which need to know about timing or direction.
1524type Touch = { x:Int, y:Int, id:Int, x0:Int, y0:Int, t0:Time }
25+-}
1626
17−-- A list of ongoing touches.
27+{-| A list of ongoing touches. -}
1828touches : Signal [Touch]
1929touches = Native.Touch.touches
2030
21−-- The last position that was tapped. Default value is `{x=0,y=0}`.
22−-- Updates whenever the user taps the screen.
31+{-| The last position that was tapped. Default value is `{x=0,y=0}`.
32+Updates whenever the user taps the screen.
33+-}
2334taps : Signal { x:Int, y:Int }
24−taps = Native.Touch.taps
35+taps = Native.Touch.taps