1.2.3-SNAPSHOT Arrow_down_16x16
  • (sketch & methods)

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source incanter/processing.clj:1625 top

(defmacro sketch [& methods]
" Returns a Processing PApplet with the given methods.

    methods -- Processing methods including: setup (require)
               draw, mousePressed, etc.


(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))


  `(let [sktch# (proxy [processing.core.PApplet] [] ~@methods)]
     (do (.init sktch#)
Vars in incanter.processing/sketch: defmacro methods apply concat let list proxy seq vector
Used in 0 other vars

Comments top

No comments for sketch. Log in to add a comment.