view skin/compose.rkt @ 1:bffc42c9b7c5

Added tag 1.0-beta for changeset 27280b550d56
author Mikhail Kryshen <mikhail@kryshen.net>
date Wed, 17 Feb 2016 23:58:34 +0300
parents 27280b550d56
children
line wrap: on
line source

#lang racket
(require 2htdp/image)
(require lang/posn)

(define background (bitmap/file "background.png"))
(define tile (bitmap/file "tile.png"))
(define snake (bitmap/file "snake.png"))
(define snake-mask (bitmap/file "snake_mask.png"))

(define s (image-width tile))

(define head (crop 0 0 s s snake))
(define head-mask (crop 0 0 s s snake-mask))

(define body (crop 0 s s s snake))
(define body-mask (crop 0 s s s snake-mask))

(define corner (crop 0 (* s 2) s s snake))
(define corner-mask (crop 0 (* s 2) s s snake-mask))

(define (orientations pict)
  (beside/align "top"
                pict
                (rotate -90 pict)
                (rotate 180 pict)
                (rotate 90 pict)))

(save-image
 (above/align "left"
              background
              (beside tile
                      (orientations head)
                      (orientations body)
                      (orientations corner)
                      (orientations head-mask)
                      (orientations body-mask)
                      (orientations corner-mask)))
 "skin.png")