(defmacro sketch [& methods]
" Returns a Processing PApplet with the given methods.
Arguments:
methods -- Processing methods including: setup (require)
draw, mousePressed, etc.
Examples:
(use '(incanter core processing))
(let [map-image (ref nil)
sktch (sketch
;; define the setup function
(setup []
(dosync (ref-set map-image
(load-image this \"examples/images/map.png\")))
(size this 640 400))
;; define the draw function
(draw []
(doto this
;(background-float 255)
(background 255)
(image @map-image 0 0))))]
(view-sketch sktch :title \"US Map\" :width 640 :height 400))
References:
http://processing.org/reference/
"
`(let [sktch# (proxy [processing.core.PApplet] [] ~@methods)]
(do (.init sktch#)
sktch#)))
Used in 0 other vars
Comments top
No comments for sketch. Log in to add a comment.