@@ -15,7 +15,7 @@ data FillStyle
1515 | Gradient Gradient
1616
1717data BasicForm
18− = FLine LineStyle Line
18+ = FPath LineStyle Path
1919 | FShape (Either LineStyle FillStyle) Shape
2020 | FImage Int Int (Int,Int) String
2121 | FElement Element
@@ -32,28 +32,27 @@ textured src shape = fill (Texture src) shape
3232gradient : Gradient -> Shape -> Form
3333gradient grad shape = fill (Gradient grad) shape
3434
35+outline : LineStyle -> Shape -> Form
3536outline style shape = Form [] (FShape (Left style) shape)
36−trace style line = Form [] (FLine style line)
3737
38+outline : LineStyle -> Path -> Form
39+trace style path = Form [] (FPath style path)
40+
41+sprite : Int -> Int -> (Int,Int) -> String -> Form
3842sprite w h pos src = Form [] (FImage w h pos src)
43+
44+toForm : Element -> Form
3945toForm e = Form [] (FElement e)
4046
4147group fs = Form [] (FGroup fs)
4248
43−add t f = { transforms = Matrix.multiply t f.transforms, form = f.form }
44−
45−radians t = t
46−degrees dep = pi * deg / 180
47−rotations rot = 2 * pi * rot
48−
49−rotate t = add (Matrix.rotate t)
50−
51−scale s = add (Matrix.scale s s)
52−scaleX s = add (Matrix.scale s 1)
53−scaleY s = add (Matrix.scale 1 s)
54−
55−move x y = add (Matrix.translate x y)
56−moveX x = add (Matrix.translate x 0)
57−moveY y = add (Matrix.translate 0 y)
49+rotate t f = { form = f.form, transform = Matrix.rotate t f.transform }
50+scale s f = { form = f.form, transform = Matrix.scale s s f.transform }
51+scaleX s f = { form = f.form, transform = Matrix.scale s 1 f.transform }
52+scaleY s f = { form = f.form, transform = Matrix.scale 1 s f.transform }
53+move x y f = { form = f.form, transform = Matrix.move x y f.transform }
54+moveX x f = { form = f.form, transform = Matrix.move x 0 f.transform }
55+moveY y f = { form = f.form, transform = Matrix.move 0 y f.transform }
5856
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 }