@@ -15,7 +15,7 @@ data FillStyle
15 | Gradient Gradient
15 | Gradient Gradient
17data BasicForm
17data BasicForm
18− = FLine LineStyle Line
18+ = FPath LineStyle Path
19 | FShape (Either LineStyle FillStyle) Shape
19 | FShape (Either LineStyle FillStyle) Shape
20 | FImage Int Int (Int,Int) String
20 | FImage Int Int (Int,Int) String
21 | FElement Element
21 | FElement Element
@@ -32,28 +32,27 @@ textured src shape = fill (Texture src) shape
32gradient : Gradient -> Shape -> Form
32gradient : Gradient -> Shape -> Form
33gradient grad shape = fill (Gradient grad) shape
33gradient grad shape = fill (Gradient grad) shape
35+outline : LineStyle -> Shape -> Form
35outline style shape = Form [] (FShape (Left style) shape)
36outline style shape = Form [] (FShape (Left style) shape)
36−trace style line = Form [] (FLine style line)
38+outline : LineStyle -> Path -> Form
39+trace style path = Form [] (FPath style path)
41+sprite : Int -> Int -> (Int,Int) -> String -> Form
38sprite w h pos src = Form [] (FImage w h pos src)
42sprite w h pos src = Form [] (FImage w h pos src)
44+toForm : Element -> Form
39toForm e = Form [] (FElement e)
45toForm e = Form [] (FElement e)
41group fs = Form [] (FGroup fs)
47group fs = Form [] (FGroup fs)
43−add t f = { transforms = Matrix.multiply t f.transforms, form = f.form }
49+rotate t f = { form = f.form, transform = Matrix.rotate t f.transform }
44−
50+scale s f = { form = f.form, transform = Matrix.scale s s f.transform }
46−degrees dep = pi * deg / 180
47−rotations rot = 2 * pi * rot
49−rotate t = add (Matrix.rotate t)
51−scale s = add (Matrix.scale s s)
52−scaleX s = add (Matrix.scale s 1)
51+scaleX s f = { form = f.form, transform = Matrix.scale s 1 f.transform }
53−scaleY s = add (Matrix.scale 1 s)
52+scaleY s f = { form = f.form, transform = Matrix.scale 1 s f.transform }
54−
53+move x y f = { form = f.form, transform = Matrix.move x y f.transform }
55−move x y = add (Matrix.translate x y)
54+moveX x f = { form = f.form, transform = Matrix.move x 0 f.transform }
56−moveX x = add (Matrix.translate x 0)
55+moveY y f = { form = f.form, transform = Matrix.move 0 y f.transform }
57−moveY y = add (Matrix.translate 0 y)
59−transform a b c d e f = add (Matrix.matrix a b c d e f)
57+transform u v w x y z f =
58+ { form = f.form, transform = Matrix.matrix u v w x y z f.transform }