Skip to content

Translate Transform

RyanGlScott edited this page Oct 9, 2014 · 4 revisions

{-# LANGUAGE OverloadedStrings #-}
module Main where

import Graphics.Blank

main :: IO ()
main = blankCanvas 3000 $ \ context -> do
    send context $ do
        let rectWidth = 150;
        let rectHeight = 75;
        translate(width context / 2, height context / 2);
        fillStyle "blue";
        fillRect(rectWidth / (-2), rectHeight / (-2), rectWidth, rectHeight);
Clone this wiki locally