elm/core/Touch.elm
evancz d53cecf3ba List module dependencies in elm and js code.
Planning on having the compiler crawl through to determine dependencies, then compile everything in an appropriate order. This will also let me print out compiler progress in a reasonable order.
2013-02-23 00:19:40 +01:00

21 lines
No EOL
784 B
Elm

-- This is an early version of the touch library. It will likely grow to
-- include gestures that would be useful for both games and web-pages.
module Touch where
import Native.Touch
type Touch = { x:Int, y:Int, id:Int, x0:Int, y0:Int, t0:Time }
-- A list of touches. Each ongoing touch is represented by a set of
-- coordinates and an identifier id that allows you to distinguish
-- between different touches. Each touch also contains the coordinates and
-- time of the initial contact (x0, y0, and t0) which helps compute more
-- complicated gestures.
touches : Signal [Touch]
touches = Native.Touch.touches
-- The last position that was tapped. Default value is `{x=0,y=0}`.
-- Updates whenever the user taps the screen.
taps : Signal { x:Int, y:Int }
taps = Native.Touch.taps