Portability | semi-portable (uses MPTC and type families) |
---|---|
Stability | experimental |
Maintainer | felipe.lessa@gmail.com |
Safe Haskell | Safe-Infered |
Support for the graphical abilities of dzen
. Unfortunately
this is not the strongest are of dzen
, so there isn't a lot
of functionality here, but there are "bindings" for every
function they provide.
You can draw:
- icons
- With
icon
(seedzen
documentation about formats and paths). - rectanges
- With
rect
andrectO
. - circles
- With
circ
andcircO
.
Although it may seem that you can draw anything with the rectangle
primitive (i.e. in the worst case just use 1x1 rectangles to simulate
pixels), dzen
does not allow you to control the y
part of the
shapes, only the x
part (using pos
and absPos
): they are always
vertically centered.
Data types
These data types are used to hint the purpose of each argument, making the type signatures more clear.
Icons
Shapes
rect :: Width -> Height -> DStringSource
rect w h
draws and fills a rectangle of width w
and height h
. The rectangle is vertically centered
(that is, if h == 1
then it is a centered line,
something like ----
).
rectO :: Width -> Height -> DStringSource
Like rect
, but only draws and does not fills (i.e.
draws an outline).
circ :: Radius -> DStringSource
circ r
draws and fils a circle of radius r
, also
vertically centered.
Positioning
pos p
moves the position of the next input p
pixels
to the right. Note that p
may be negative, effectively
moving to the right.
absPos :: Int -> DStringSource
absPos p
moves the position of the next input to be
exactly p
pixels to the right of the initial position.
This should be used with care.