on master help sign in
updated syntax in the mouse example
e0d5650Vladimir Bychkovsky
Examples/elm-happstack/elm_source/mouse.elm+4−4
@@ -1,15 +1,15 @@
1
1
2-- Move your mouse around above the canvas!
2-- Move your mouse around above the canvas!
3
3
4−import Signal.Mouse (position)
4+import Mouse (position)
5−import Signal.Window (dimensions)
5+import Window (dimensions)
6
6
7myBlue = rgb 0 85 170
7myBlue = rgb 0 85 170
8myGreen = rgba 28 267 85 (1/2)
8myGreen = rgba 28 267 85 (1/2)
9
9
10scene (x,y) (w,h) =
10scene (x,y) (w,h) =
11− collage w h [ filled myBlue . rotate ((x+y)/1000) $ ngon 4 100 (200,200)
11+ collage w h [ rotate (toFloat (x+y) / 1000) $ filled myBlue $ ngon 4 100 (200,200)
12 , filled myGreen $ ngon 5 30 (x,y)
12 , filled myGreen $ ngon 5 30 (x,y)
13 ]
13 ]
14
14
15−main = lift2 scene position dimensions
15+main = lift2 scene Mouse.position Window.dimensions