current-frame-rate

current-graphics

cursor

cursor-image

defsketch

display-densityclj

focused

frame-count

frame-rate

height

no-cursor

pixel-densityclj

screen-heightclj

screen-widthclj

sketch

target-frame-rate

width

current-frame-rate

Arguments
[]
Docstring
Returns the current framerate
Works only inside sketch functions?
Yes
Original Processing method
frameRate

current-graphics

Arguments
[]
Docstring
Graphics currently used for drawing. By default it is sketch graphics,
but if called inside with-graphics macro - graphics passed to the macro
is returned. This method should be used if you need to call some methods
that are not implemented by quil. Example:
(.beginDraw (current-graphics)).
Works only inside sketch functions?
Yes
Original Processing method
None. It is present only in Quil.

cursor

Arguments
[][cursor-mode]
Docstring
Sets the cursor to a predefined symbol or makes it
visible if already hidden (after no-cursor was called).

Available modes: :arrow, :cross, :hand, :move, :text, :wait

See cursor-image for specifying a generic image as the cursor
symbol.
Works only inside sketch functions?
Yes
Original Processing method
cursor()

cursor-image

Arguments
[img hx hy][img]
Docstring
Set the cursor to a predefined image. The horizontal and vertical
active spots of the cursor may be specified with hx and hy.
It is recommended to make the size 16x16 or 32x32 pixels.
Works only inside sketch functions?
Yes
Original Processing method
cursor()

defsketch

Arguments
[app-name & options]
Docstring
Define and start a sketch 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 fns are reflected in
the visualisation.

Available options:

 :size           - A vector of width and height for the sketch or :fullscreen.
                   Defaults to [500 300]. If you're using :fullscreen you may
                   want to enable present mode - :features [:present]

 :renderer       - Specifies the renderer type. One of :p2d, :p3d, :java2d,
                   :opengl, :pdf). Defaults to :java2d. :dxf renderer
                   can't be used as sketch renderer. Use begin-raw method
                   instead. In clojurescript only :p2d and :p3d renderers
                   are supported.

 :output-file    - Specifies an output file path. Only used in :pdf mode.
                   Not supported in clojurescript.

 :title          - A string which will be displayed at the top of
                   the sketch window. Not supported in clojurescript.

 :features       - A vector of keywords customizing sketch behaviour.
                   Supported features:

                   :keep-on-top - Sketch window will always be above other
                                  windows. Note: some platforms might not
                                  support always-on-top windows.
                                  Not supported in clojurescript.

                   :exit-on-close - Shutdown JVM  when sketch is closed.
                                    Not supported in clojurescript.

                   :resizable - Makes sketch resizable.
                                Not supported in clojurescript.

                   :no-safe-fns - Do not catch and print exceptions thrown
                                  inside functions provided to sketch (like
                                  draw, mouse-click, key-pressed and
                                  other). By default all exceptions thrown
                                  inside these functions are catched. This
                                  prevents sketch from breaking when bad
                                  function was provided and allows you to
                                  fix it and reload it on fly. You can
                                  disable this behaviour by enabling
                                  :no-safe-fns feature.
                                  Not supported in clojurescript.

                   :present - Switch to present mode (fullscreen without
                              borders, OS panels). You may want to use
                              this feature together with :size :fullscreen.
                              Not supported in clojurescript.

                   :no-start - Disables autostart if sketch was created using
                               defsketch macro. To start sketch you have to
                               call function created defsketch.
                               Supported only in clojurescript.

                   :global-key-events - Allows a sketch to receive any
                                        keyboard event sent to the page,
                                        regardless of whether the canvas it is
                                        loaded in has focus or not.
                                        Supported only in clojurescript.

                   Usage example: :features [:keep-on-top :present]

 :bgcolor        - Sets background color for unused space in present mode.
                   Color is specified in hex format: #XXXXXX.
                   Example: :bgcolor "#00FFFF" (cyan background)
                   Not supported in clojurescript.

 :display        - Sets what display should be used by this sketch.
                   Displays are numbered starting from 0. Example: :display 1.
                   Not supported in clojurescript.

 :setup          - A function to be called once when setting the sketch up.

 :draw           - A function to be repeatedly called at most n times per
                   second where n is the target frame-rate set for
                   the visualisation.

 :host           - String id of canvas element or DOM element itself.
                   Specifies host for the sketch. Must be specified in sketch,
                   may be omitted in defsketch. If ommitted in defsketch,
                   :host is set to the name of the sketch. If element with
                   specified id is not found on the page and page is empty -
                   new canvas element will be created. Used in clojurescript.

 :focus-gained   - Called when the sketch gains focus.
                   Not supported in clojurescript.

 :focus-lost     - Called when the sketch loses focus.
                   Not supported in clojurescript.

 :mouse-entered  - Called when the mouse enters the sketch window.

 :mouse-exited   - Called when the mouse leaves the sketch window

 :mouse-pressed  - Called every time a mouse button is pressed.

 :mouse-released - Called every time a mouse button is released.

 :mouse-clicked  - called once after a mouse button has been pressed
                   and then released.

 :mouse-moved    - Called every time the mouse moves and a button is
                   not pressed.

 :mouse-dragged  - Called every time the mouse moves and a button is
                   pressed.

 :mouse-wheel    - Called every time mouse wheel is rotated.
                   Takes 1 argument - wheel rotation, an int.
                   Negative values if the mouse wheel was rotated
                   up/away from the user, and positive values
                   if the mouse wheel was rotated down/ towards the user

 :key-pressed    - Called every time any key is pressed.

 :key-released   - Called every time any key is released.

 :key-typed      - Called once every time non-modifier keys are
                   pressed.

 :on-close       - Called once, when sketch is closed
                   Not supported in clojurescript.

 :middleware     - Vector of middleware to be applied to the sketch.
                   Middleware will be applied in the same order as in comp
                   function: [f g] will be applied as (f (g options)).

 :settings       - cousin of :setup. A function to be called once when
                   setting sketch up. Should be used only for (smooth) and
                   (no-smooth). Due to Processing limitations these functions
                   cannot be used neither in :setup nor in :draw.
Works only inside sketch functions?
No
Original Processing method
None. It is present only in Quil.

display-densityclj

Arguments
[display][]
Docstring
This function returns the number 2 if the screen is a high-density
screen (called a Retina display on OS X or high-dpi on Windows and
Linux) and a 1 if not. This information is useful for a program to
adapt to run at double the pixel density on a screen that supports
it. Can be used in conjunction with (pixel-density)
Works only inside sketch functions?
Yes
Original Processing method
displayDensity()

focused

Arguments
[]
Docstring
Returns a boolean value representing whether the applet has focus.
Works only inside sketch functions?
Yes
Original Processing method
focused

frame-count

Arguments
[]
Docstring
The system variable frameCount contains the number of frames
displayed since the program started. Inside setup() the value is 0
and after the first iteration of draw it is 1, etc.
Works only inside sketch functions?
Yes
Original Processing method
frameCount

frame-rate

Arguments
[new-rate]
Docstring
Specifies a new target framerate (number of frames to be displayed every
second). If the processor is not fast enough to maintain the
specified rate, it will not be achieved. For example, the function
call (frame-rate 30) will attempt to refresh 30 times a second. It
is recommended to set the frame rate within setup. The default rate
is 60 frames per second.
Works only inside sketch functions?
Yes
Original Processing method
frameRate()

height

Arguments
[]
Docstring
Height of the display window. The value of height is zero until
size is called.
Works only inside sketch functions?
Yes
Original Processing method
getHeight()

no-cursor

Arguments
[]
Docstring
Hides the cursor from view. Will not work when running the in full
screen (Present) mode.
Works only inside sketch functions?
Yes
Original Processing method
noCursor()

pixel-densityclj

Arguments
[density]
Docstring
It makes it possible for Processing to render using all of the pixels
on high resolutions screens like Apple Retina displays and Windows
High-DPI displays. Possible values 1 or 2. Must be called only from
:settings handler. To get density of the current screen you can use
(display-density) function.
Works only inside sketch functions?
Yes
Original Processing method
pixelDensity()

screen-heightclj

Arguments
[]
Docstring
Returns the height of the main screen in pixels.
Works only inside sketch functions?
No
Original Processing method
None. It is present only in Quil.

screen-widthclj

Arguments
[]
Docstring
Returns the width of the main screen in pixels.
Works only inside sketch functions?
No
Original Processing method
None. It is present only in Quil.

sketch

Arguments
[& opts]
Docstring
Create and start a new visualisation applet. Can be used to create
new sketches programmatically. See documentation for 'defsketch' for
list of available options.
Works only inside sketch functions?
No
Original Processing method
None. It is present only in Quil.

target-frame-rate

Arguments
[]
Docstring
Returns the target framerate specified with the fn frame-rate
Works only inside sketch functions?
Yes
Original Processing method
None. It is present only in Quil.

width

Arguments
[]
Docstring
Width of the display window. The value of width is zero until size is
called.
Works only inside sketch functions?
Yes
Original Processing method
getWidth()