Module

Hylograph.Isometric.HATS

Package
purescript-hylograph-isometric
Repository
afcondon/purescript-hylograph-isometric

Drawing what the camera produces as keyed SVG, with HATS.

Everything here is a thin layer over the pure geometry: path data from projected points, a prism's visible faces as keyed paths, and a scene's marks joined by key in the painter's order. Because the keys stay the same as the camera turns, redrawing with a turned camera moves the elements already there (and puts them in the new order), so a turn can be animated frame by frame with rerender.

#pathData Source

pathData :: Array Point -> String

A closed SVG path through the points.

#pointsData Source

pointsData :: Array Point -> String

The points as an SVG points attribute (for polygon and polyline).

#prismFaces Source

prismFaces :: String -> (DrawnFace -> Array Attr) -> Camera -> Prism -> Tree

A prism's visible faces as SVG paths, keyed by face, each given the attributes style chooses for it (typically a fill from its facing or lightness).

#inPaintersOrder Source

inPaintersOrder :: forall a. String -> ElementType -> Camera -> { footprint :: a -> Outline, key :: a -> String, template :: a -> Tree } -> Array a -> Tree

Marks joined by key, in the painter's order for their floor footprints: each is drawn by template into an element of the given type (usually a Group).