Functions and macros for initialising and controlling visualisation applets.
Functions and macros for initialising and controlling visualisation applets.
(-exitActual this)
Overriding PApplet.exitActual
because we don't want it to call
System.exit()
.
Overriding `PApplet.exitActual` because we don't want it to call `System.exit()`.
(-settings this)
Overriding PApplet.settings()
to set size.
Overriding `PApplet.settings()` to set size.
(applet & opts)
Create and start a new visualisation applet. All options used
here should be documented in the quil.sketch/defsketch
docstring.
Create and start a new visualisation applet. All options used here should be documented in the [[quil.sketch/defsketch]] docstring.
(applet-disposed applet)
This function is called when PApplet
executes dispose
method. It means we
can dispose the frame, call the on-close
function and perform other
cleanups.
This function is called when `PApplet` executes `dispose` method. It means we can dispose the frame, call the `on-close` function and perform other cleanups.
(applet-state applet k)
Fetch an element of state from within the applet
.
Fetch an element of state from within the `applet`.
(defapplet app-name & opts)
Define and start an applet and bind it to
a var with the symbol app-name
. If any
of the options to the various callbacks are symbols, it wraps them in a call
to var
to ensure they aren't inlined and that redefinitions to the original
functions are reflected in the visualisation. See applet
for the available
options.
Define and start an applet and bind it to a [var](https://clojure.org/reference/vars) with the symbol `app-name`. If any of the options to the various callbacks are symbols, it wraps them in a call to `var` to ensure they aren't inlined and that redefinitions to the original functions are reflected in the visualisation. See [[applet]] for the available options.
(generate-listeners)
Generates all listeners like onKeyPress
, onMouseClick
and others.
Generates all listeners like `onKeyPress`, `onMouseClick` and others.
(resolve-renderer renderer)
Converts renderer
keyword to Processing
renderer String
constant.
This String
can be passed to native Processing
methods.
If renderer
is passed as String
do nothing and simply return it.
Converts `renderer` keyword to `Processing` renderer `String` constant. This `String` can be passed to native `Processing` methods. If `renderer` is passed as `String` do nothing and simply return it.
(with-applet applet & body)
Binds dynamic var to current applet.
Binds dynamic var to current applet.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close