(add-fullscreen-support applet)
Adds fullscreen support for the provided p5
object.
Fullscreen is enabled when the user presses F11
. We turn
the sketch <canvas>
element to fullscreen storing the old size
in an atom
. When the user cancels fullscreen (F11
or Esc
)
we resize the sketch back to the old size.
Adds fullscreen support for the provided `p5` object. Fullscreen is enabled when the user presses `F11`. We turn the sketch `<canvas>` element to fullscreen storing the old size in an `atom`. When the user cancels fullscreen (`F11` or `Esc`) we resize the sketch back to the old size.
(wrap-fns opts)
wrap-fns
allows dynamic redefinition of a function such as draw
and
update
in cljs. This is achieved by wrapping all provided functions to
anonymous functions such that my-draw
function turns into
(fn [& args] (apply my-draw args))
. This adds a level of indirection
so that when quil calls draw
, it invokes anonymous function which in
turn always calls my-draw
by name and if you redefine, the new version
will be used. Hence we need this cryptic macro.
[[wrap-fns]] allows dynamic redefinition of a function such as `draw` and `update` in cljs. This is achieved by wrapping all provided functions to anonymous functions such that `my-draw` function turns into `(fn [& args] (apply my-draw args))`. This adds a level of indirection so that when quil calls `draw`, it invokes anonymous function which in turn always calls `my-draw` by name and if you redefine, the new version will be used. Hence we need this cryptic macro.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close