Module
Reactor.Graphics.Drawing
- Package
- purescript-grid-reactors
- Repository
- Eugleo/purescript-grid-reactors
This module provides the means of producing a drawing of the reactor's world. The drawing is then rendered on canvas. Currently, only grid-based drawings are supported.
#Drawing Source
type Drawing = DrawingM Unit
DrawingM
is usually too general; our drawing-contructing functions don't need to return
anything. Internal implementation detail.
Usually, constructing a drawing will look something like this.
drawTwoPoints :: CoordinateSystem Point -> CoordinateSystem Point -> Drawing
drawTwoPoints blueXY redXY = do
fill Color.blue400 $ cell blueXY
fill Color.red400 $ cell redXY
#DrawingM Source
newtype DrawingM a
A free monad for DrawingF
that enables you to use do
-notation when constructing drawings.
Internal implementation detail.
Constructors
Instances
#DrawingF Source
data DrawingF a
A DSL for constructing drawings. Currently, only filled shapes are supported. Mostly for internal use.
Most of the time, you construct a drawing by calling the different helper functions, like fill
, instead of
manually constructing a DrawingF
.