Liking cljdoc? Tell your friends :D

monet.canvas

The canvas namespace provides functions which can be used for rendering graphs, game graphics, art, or othe visual images on the fly.

See http://www.w3.org/TR/html5/scripting-1.html#the-canvas-element and http://www.w3.org/TR/2dcontext/

The canvas namespace provides functions which can be used for
rendering graphs, game graphics, art, or othe visual images
on the fly.

See http://www.w3.org/TR/html5/scripting-1.html#the-canvas-element and
http://www.w3.org/TR/2dcontext/
raw docstring

add-entitycljs

(add-entity mc k ent)
source

alphacljs

(alpha ctx a)

Global Alpha value that is applied to shapes and images before they are composited onto the canvas. Default 1.0 (opaque).

Global Alpha value that is applied to shapes and images before they are
composited onto the canvas. Default 1.0 (opaque).
sourceraw docstring

arccljs

(arc ctx {:keys [x y r start-angle end-angle counter-clockwise?]})

Draws an arc at position (x, y) with radius r, beginning at start-angle, finishing at end-angle, in the direction specified.

Draws an arc at position (x, y) with radius r, beginning at start-angle,
finishing at end-angle, in the direction specified.
sourceraw docstring

begin-pathcljs

(begin-path ctx)

Starts a new path by resetting the list of sub-paths. Call this method when you want to create a new path.

Starts a new path by resetting the list of sub-paths.
Call this method when you want to create a new path.
sourceraw docstring

bezier-curve-tocljs

(bezier-curve-to ctx {:keys [cp1x cp1y cp2x cp2y x y]})
(bezier-curve-to ctx cp1x cp1y cp2x cp2y x y)
source

circlecljs

(circle ctx {:keys [x y r]})

Draws a circle at position (x, y) with radius r

Draws a circle at position (x, y) with radius r
sourceraw docstring

clear!cljs

(clear! mc)
source

clear-rectcljs

(clear-rect ctx {:keys [x y w h]})

Sets all pixels in the rectangle defined by starting point (x, y) and size (w, h) to transparent black.

Sets all pixels in the rectangle defined by starting point (x, y)
and size (w, h) to transparent black.
sourceraw docstring

clipcljs

(clip ctx)

Further constrains the clipping region to the current path.

Further constrains the clipping region to the current path.
sourceraw docstring

close-pathcljs

(close-path ctx)

Tries to draw a straight line from the current point to the start. If the shape has already been closed or has only one point, this function does nothing.

Tries to draw a straight line from the current point to the start.
If the shape has already been closed or has only one point, this
function does nothing.
sourceraw docstring

composition-operationcljs

(composition-operation ctx operation)

With Global Alpha applied this sets how shapes and images are drawn onto the existing bitmap. Possible values (as string or keyword): source-atop, source-in, source-out, source-over (default), destination-atop, destination-in, destination-out, destination-over, lighter, darker, copy, xor

With Global Alpha applied this sets how shapes and images are drawn
onto the existing bitmap. Possible values (as string or keyword):
source-atop, source-in, source-out, source-over (default),
destination-atop, destination-in, destination-out, destination-over,
lighter, darker, copy, xor
sourceraw docstring

draw-imagecljs

(draw-image ctx img {:keys [x y w h sx sy sw sh dx dy dw dh] :as params})
(draw-image ctx img x y)

Draws the image onto the canvas at the given position. If a map of params is given, the number of entries is used to determine the underlying call to make.

Draws the image onto the canvas at the given position.
If a map of params is given, the number of entries is used to
determine the underlying call to make.
sourceraw docstring

draw-loopcljs

(draw-loop {:keys [canvas updating? ctx active entities last-frame-time]
            :as mc})
source

ellipsecljs

(ellipse ctx {:keys [x y rw rh]})

Draws an ellipse at position (x, y) with radius (rw, rh)

Draws an ellipse at position (x, y) with radius (rw, rh)
sourceraw docstring

entitycljs

(entity v update draw)
source

fillcljs

(fill ctx)

Fills the subpaths with the current fill style.

Fills the subpaths with the current fill style.
sourceraw docstring

fill-rectcljs

(fill-rect ctx {:keys [x y w h]})

Draws a filled rectangle at (x, y) position whose size is determined by width w and height h.

Draws a filled rectangle at (x, y) position whose size is determined
by width w and height h.
sourceraw docstring

fill-stylecljs

(fill-style ctx color)

Color or style to use inside shapes. Default #000 (black).

Color or style to use inside shapes. Default #000 (black).
sourceraw docstring

font-stylecljs

(font-style ctx font)

Sets the font. Default value 10px sans-serif.

Sets the font. Default value 10px sans-serif.
sourceraw docstring

get-contextcljs

(get-context canvas type)
source

get-entitycljs

(get-entity mc k)
source

get-pixelcljs

(get-pixel ctx x y)

Gets the pixel value as a hash map of RGBA values

Gets the pixel value as a hash map of RGBA values
sourceraw docstring

initcljs

(init canvas & [context-type])
source

line-tocljs

(line-to ctx x y)

Connects the last point in the subpath to the x, y coordinates with a straight line.

Connects the last point in the subpath to the x, y coordinates with a
straight line.
sourceraw docstring

monet-canvascljs

(monet-canvas elem context-type)
source

move-tocljs

(move-to ctx x y)

Moves the starting point of a new subpath to the (x, y) coordinates.

Moves the starting point of a new subpath to the (x, y) coordinates.
sourceraw docstring

quadratic-curve-tocljs

(quadratic-curve-to ctx {:keys [cpx cpy x y]})
(quadratic-curve-to ctx cpx cpy x y)
source

rectcljs

(rect ctx {:keys [x y w h]})

Path for a rectangle at position (x, y) with a size (w, h).

Path for a rectangle at position (x, y) with a size (w, h).
sourceraw docstring

remove-entitycljs

(remove-entity mc k)
source

restartcljs

(restart mc)
source

restorecljs

(restore ctx)

Restores the drawing style state to the last element on the 'state stack' saved by save.

Restores the drawing style state to the last element on the 'state stack'
saved by save.
sourceraw docstring

rotatecljs

(rotate ctx angle)

Rotate the context

Rotate the context 
sourceraw docstring

rounded-rectcljs

(rounded-rect ctx {:keys [x y w h r]})
source

savecljs

(save ctx)

Saves the current drawing style state using a stack so you can revert any change you make to it using restore.

Saves the current drawing style state using a stack so you can revert
any change you make to it using restore.
sourceraw docstring

scalecljs

(scale ctx x y)

Scales the context by a floating-point factor in each direction

Scales the context by a floating-point factor in each direction
sourceraw docstring

start-updatingcljs

(start-updating mc)
source

stopcljs

(stop mc)
source

stop-updatingcljs

(stop-updating mc)
source

strokecljs

(stroke ctx)

Strokes the subpaths with the current stroke style.

Strokes the subpaths with the current stroke style.
sourceraw docstring

stroke-capcljs

(stroke-cap ctx cap)

Sets the line cap. Possible values (as string or keyword): butt (default), round, square

Sets the line cap. Possible values (as string or keyword):
butt (default), round, square
sourceraw docstring

stroke-joincljs

(stroke-join ctx join)

Can be set, to change the line join style. Possible values (as string or keyword): bevel, round, and miter. Other values are ignored.

Can be set, to change the line join style. Possible values (as string
or keyword): bevel, round, and miter. Other values are ignored.
sourceraw docstring

stroke-rectcljs

(stroke-rect ctx {:keys [x y w h]})

Paints a rectangle which has a starting point at (x, y) and has a w width and an h height onto the canvas, using the current stroke style.

Paints a rectangle which has a starting point at (x, y) and has a
w width and an h height onto the canvas, using the current stroke
style.
sourceraw docstring

stroke-stylecljs

(stroke-style ctx color)

Color or style to use for the lines around shapes. Default #000 (black).

Color or style to use for the lines around shapes. Default #000 (black).
sourceraw docstring

stroke-widthcljs

(stroke-width ctx w)

Sets the line width. Default 1.0

Sets the line width. Default 1.0
sourceraw docstring

textcljs

(text ctx {:keys [text x y]})

Paints the given text at a starting point at (x, y), using the current fill style.

Paints the given text at a starting point at (x, y), using the
current fill style.
sourceraw docstring

text-aligncljs

(text-align ctx alignment)

Sets the text alignment attribute. Possible values (specified as a string or keyword): start (default), end, left, right or center.

Sets the text alignment attribute. Possible values (specified
as a string or keyword): start (default), end, left, right or
center.
sourceraw docstring

text-baselinecljs

(text-baseline ctx alignment)

Sets the text baseline attribute. Possible values (specified as a string or keyword): top, hanging, middle, alphabetic (default), ideographic, bottom

Sets the text baseline attribute. Possible values (specified
as a string or keyword): top, hanging, middle, alphabetic (default),
ideographic, bottom
sourceraw docstring

transformcljs

(transform ctx {:keys [m11 m12 m21 m22 dx dy]})
(transform ctx m11 m12 m21 m22 dx dy)

Multiplies a custom transformation matrix to the existing HTML5 canvas transformation according to the follow convention:

[ x'] [ m11 m21 dx ] [ x ] [ y'] = [ m12 m22 dy ] [ y ] [ 1 ] [ 0 0 1 ] [ 1 ]

Multiplies a custom transformation matrix to the existing
HTML5 canvas transformation according to the follow convention:

[ x']   [ m11 m21 dx ] [ x ]
[ y'] = [ m12 m22 dy ] [ y ]
[ 1 ]   [ 0   0   1  ] [ 1 ]
sourceraw docstring

translatecljs

(translate ctx x y)

Moves the origin point of the context to (x, y).

Moves the origin point of the context to (x, y).
sourceraw docstring

update-entitycljs

(update-entity mc k func & extra)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close