[mode]
Modifies the origin of the ellispse according to the specified mode: :center - specifies the location of the ellipse as the center of the shape. (Default). :radius - similar to center, but the width and height parameters to ellipse specify the radius of the ellipse, rather than the diameter. :corner - draws the shape from the upper-left corner of its bounding box. :corners - uses the four parameters to ellipse to set two opposing corners of the ellipse's bounding box.
(q/stroke-weight 5) (q/ellipse-mode :center) (q/with-translation [125 125] (q/ellipse 0 0 100 70) (q/point 0 0)) (q/ellipse-mode :radius) (q/with-translation [375 125] (q/ellipse 0 0 100 70) (q/point 0 0)) (q/ellipse-mode :corner) (q/with-translation [125 375] (q/ellipse 0 0 100 70) (q/point 0 0)) (q/ellipse-mode :corners) (q/with-translation [375 375] (q/ellipse -50 -35 50 35) (q/point -50 -35) (q/point 50 35))try example
[]
Draws all geometry with jagged (aliased) edges. Must be called inside :settings handler.
(q/with-translation [125 125] (q/ellipse 0 0 200 200))try example
[mode]
Modifies the location from which rectangles draw. The default mode is :corner. Available modes are: :corner - Specifies the location to be the upper left corner of the shape and uses the third and fourth parameters of rect to specify the width and height. :corners - Uses the first and second parameters of rect to set the location of one corner and uses the third and fourth parameters to set the opposite corner. :center - Draws the image from its center point and uses the third and forth parameters of rect to specify the image's width and height. :radius - Draws the image from its center point and uses the third and forth parameters of rect() to specify half of the image's width and height.
(q/stroke-weight 5) (q/rect-mode :center) (q/with-translation [125 125] (q/stroke 0) (q/rect 0 0 100 70) (q/stroke 255 0 0) (q/point 0 0)) (q/rect-mode :radius) (q/with-translation [375 125] (q/stroke 0) (q/rect 0 0 100 70) (q/stroke 255 0 0) (q/point 0 0)) (q/rect-mode :corner) (q/with-translation [125 375] (q/stroke 0) (q/rect 0 0 100 70) (q/stroke 255 0 0) (q/point 0 0)) (q/rect-mode :corners) (q/with-translation [375 375] (q/stroke 0) (q/rect -50 -35 50 35) (q/stroke 255 0 0) (q/point -50 -35) (q/point 50 35))try example
[level]
[]
Draws all geometry with smooth (anti-aliased) edges. This will slow down the frame rate of the application, but will enhance the visual refinement. Must be called inside :settings handler. The level parameter (int) increases the level of smoothness with the P2D and P3D renderers. This is the level of over sampling applied to the graphics buffer. The value '2' will double the rendering size before scaling it down to the display size. This is called '2x anti-aliasing.' The value 4 is used for 4x anti-aliasing and 8 is specified for 8x anti-aliasing. If level is set to 0, it will disable all smoothing; it's the equivalent of the function noSmooth(). The maximum anti-aliasing level is determined by the hardware of the machine that is running the software. Note that smooth will also improve image quality of resized images.
(q/with-translation [125 125] (q/ellipse 0 0 200 200))try example
[cap-mode]
Sets the style for rendering line endings. These ends are either squared, extended, or rounded and specified with the corresponding parameters :square, :project, and :round. The default cap is :round.
(q/stroke-weight 12) (q/stroke-cap :square) (q/line 230 200 270 200) (q/stroke-cap :project) (q/line 230 250 270 250) (q/stroke-cap :round) (q/line 230 300 270 300)try example
[join-mode]
Sets the style of the joints which connect line segments. These joints are either mitered, beveled, or rounded and specified with the corresponding parameters :miter, :bevel, and :round. The default joint is :miter. This function is not available with the :p2d, :p3d, or :opengl renderers.
(q/rect-mode :center) (q/stroke-weight 12) (q/stroke-join :miter) (q/rect 125 125 100 100) (q/stroke-join :bevel) (q/rect 375 125 100 100) (q/stroke-join :round) (q/rect 125 375 100 100)try example
[weight]
Sets the width of the stroke used for lines, points, and the border around shapes. All widths are set in units of pixels.
(doseq [i (range 1 10)] (q/stroke-weight i) (q/line 230 (+ (* i 30) 100) 270 (+ (* i 30) 100)))try example