I'm using Quil to teach someone clojure, and I really wanted to be able to just call drawing functions by themselves (so outside a draw function), to allow for more interactive exploration. Took me some figuring out so in case it's useful for anyone else:
(defn draw []
(Thread/sleep 100))
(q/defsketch mijn-sketch
:size [800 800]
:draw draw
:features [:keep-on-top])
(alter-var-root #'quil.applet/*applet* (constantly mijn-sketch))
Now you can just call any q/...
function at the top level. The Thread/sleep
is necessary because the animation thread will still be calling draw
in a loop, and only graphics that happen between the start/end of draw
will show up on the sketch.
Hello, I am trying to use Quil in combination with Emacs . when I eval the defsketch
function I am getting an exception
Unhandled java.lang.NoClassDefFoundError
com/apple/eawt/QuitHandler
1. Caused by java.lang.ClassNotFoundException
com.apple.eawt.QuitHandler
I am trying to eval the forms in the editor and not in the REPL
Has anyone seen a similar error?
Thanks!