@@ -1,7 +1,7 @@
2module Graphics.Element (widthOf, heightOf, sizeOf,
2module Graphics.Element (widthOf, heightOf, sizeOf,
3 width, height, opacity, color, tag, link,
3 width, height, opacity, color, tag, link,
4− image, fittedImage, croppedImage,
4+ image, fittedImage, croppedImage, tiledImage,
5 flow, up, down, left, right, inward, outward,
5 flow, up, down, left, right, inward, outward,
6 above, below, beside, layers,
6 above, below, beside, layers,
7 container, absolute, relative,
7 container, absolute, relative,
@@ -93,7 +93,7 @@ data ElementPrim
93 | RawHtml JSString
93 | RawHtml JSString
94 | Custom -- for custom Elements implemented in JS, see collage for example
94 | Custom -- for custom Elements implemented in JS, see collage for example
96−data ImageStyle = Plain | Fitted | Cropped (Int,Int)
96+data ImageStyle = Plain | Fitted | Cropped (Int,Int) | Tiled
98-- Create an image given a width, height, and image source.
98-- Create an image given a width, height, and image source.
99image : Int -> Int -> String -> Element
99image : Int -> Int -> String -> Element
@@ -113,6 +113,10 @@ croppedImage : Int -> Int -> (Int,Int) -> String -> Element
113croppedImage w h pos src =
113croppedImage w h pos src =
114 newElement w h (Image (Cropped pos) w h (JS.fromString src))
114 newElement w h (Image (Cropped pos) w h (JS.fromString src))
116+tiledImage : Int -> Int -> String -> Element
118+ newElement w h (Image Tiled w h (JS.fromString src))
116data Three = P | Z | N
120data Three = P | Z | N
117data Pos = Absolute Int | Relative Float
121data Pos = Absolute Int | Relative Float
118type Position = { horizontal : Three, vertical : Three, x : Pos, y : Pos }
122type Position = { horizontal : Three, vertical : Three, x : Pos, y : Pos }