@hackage nanovg-simple0.4.0.0

Simple interface to rendering with NanoVG

nanovg-simple

Simple interface to creating window with associated NanoVG context. See nanovg.h for comprehensive listing of methods.

Refer to Graphics.NanoVG.Simple module for utilities to create NanoVG window. Simple example:

import           Graphics.NanoVG.Simple
import qualified NanoVG as NVG

main :: IO ()
main = run 800 600 "Simple app" $ simpleWindow $
  NVG.circle ctx 10 10 10 *> NVG.fill ctx

Also provided is wrapper for rendering combination of composable picture pieces: see Graphics.NanoVG.Picture.

import           Graphics.NanoVG.Picture
import           Graphics.NanoVG.Simple
import qualified NanoVG as NVG

main :: IO ()
main = run 800 600 "Simple app" $ asWindow $
  pure $ translateP 50 0 $ pictures
    [ fill (NVG.Color 1 1 1 1) $ circle (10, 10) 10
    , stroke (NVG.Color 1 1 1 1) $ circle (10, 10) 15
    ]