Results 1 - 20 of 72

Path2D.addPath()

The Path2D.addPath() method of the Canvas 2D API adds to the path the path given by the argument.
API Canvas Method Path2D Path2D.addPath Reference Référence

Matrix math for the web

Matrices can be used to represent transformations of objects in space, and are an important tool to use in visualizations on the Web. This article explores how to create matrices and use them with CSS3 transforms and the matrix3d transform type.
3D CSS3 Guide matrices matrix transform3d WebGL

CanvasRenderingContext2D

To get an object of this interface, call getContext() on a <canvas> element, supplying "2d" as the argument:
API Canvas CanvasRenderingContext2D Games Graphics Reference

CanvasRenderingContext2D.addHitRegion()

The CanvasRenderingContext2D.addHitRegion() method of the Canvas 2D API adds a hit region to the bitmap. This allows you to make hit detection easier, lets you route events to DOM elements, and makes it possible for users to explore the canvas without seeing it.
API Canvas CanvasRenderingContext2D Experimental Method Reference

CanvasRenderingContext2D.arc()

The CanvasRenderingContext2D.arc() method of the Canvas 2D API adds an arc to the path which is centered at (x, y) position with radius r starting at startAngle and ending at endAngle going in the given direction by anticlockwise (defaulting to clockwise).
API Canvas CanvasRenderingContext2D Method Reference

CanvasRenderingContext2D.arcTo()

The CanvasRenderingContext2D.arcTo() method of the Canvas 2D API adds an arc to the path with the given control points and radius, connected to the previous point by a straight line.
API Canvas CanvasRenderingContext2D Method Reference Référence

CanvasRenderingContext2D.asyncDrawXULElement()

The non-standard and internal only CanvasRenderingContext2D.asyncDrawXULElement() method of the Canvas 2D API renders a region of a XUL element into the canvas.
API Canvas CanvasRenderingContext2D Method Reference

CanvasRenderingContext2D.beginPath()

The CanvasRenderingContext2D.beginPath() method of the Canvas 2D API starts a new path by emptying the list of sub-paths. Call this method when you want to create a new path.
API Canvas CanvasRenderingContext2D Method Reference Référence

CanvasRenderingContext2D.bezierCurveTo()

The CanvasRenderingContext2D.bezierCurveTo() method of the Canvas 2D API adds a cubic Bézier curve to the path. It requires three points. The first two points are control points and the third one is the end point. The starting point is the last point in the current path, which can be changed using moveTo() before creating the Bézier curve.
API Canvas CanvasRenderingContext2D Method Reference Référence

CanvasRenderingContext2D.canvas

The CanvasRenderingContext2D.canvas property is a read-only reference to the HTMLCanvasElement object that is associated with the context. It might be null if there is no association with an <canvas> element.
API Canvas CanvasRenderingContext2D Property Reference Référence

CanvasRenderingContext2D.clearHitRegions()

The CanvasRenderingContext2D.clearHitRegions() method of the Canvas 2D API removes all hit regions from the canvas.
API Canvas CanvasRenderingContext2D Experimental Method Reference

CanvasRenderingContext2D.clearRect()

The CanvasRenderingContext2D.clearRect() method of the Canvas 2D API sets all pixels in the rectangle defined by starting point (x, y) and size (width, height) to transparent black, erasing any previously drawn content.
API Canvas CanvasRenderingContext2D Method Reference Référence

CanvasRenderingContext2D.clip()

The CanvasRenderingContext2D.clip() method of the Canvas 2D API turns the path currently being built into the current clipping path.
API Canvas CanvasRenderingContext2D Method Reference Référence

CanvasRenderingContext2D.closePath()

The CanvasRenderingContext2D.closePath() method of the Canvas 2D API causes the point of the pen to move back to the start of the current sub-path. It tries to add a straight line (but does not actually draw it) from the current point to the start. If the shape has already been closed or has only one point, this function does nothing.
API Canvas CanvasRenderingContext2D Method Reference Référence

CanvasRenderingContext2D.createImageData()

The CanvasRenderingContext2D.createImageData() method of the Canvas 2D API creates a new, blank ImageData object with the specified dimensions. All of the pixels in the new object are transparent black.
API Canvas CanvasRenderingContext2D Method Reference

CanvasRenderingContext2D.createLinearGradient()

The CanvasRenderingContext2D.createLinearGradient() method of the Canvas 2D API creates a gradient along the line given by the coordinates represented by the parameters. This method returns a linear CanvasGradient.
API Canvas CanvasRenderingContext2D Gradients Method Reference

CanvasRenderingContext2D.createPattern()

The CanvasRenderingContext2D.createPattern() method of the Canvas 2D API creates a pattern using the specified image (a CanvasImageSource). It repeats the source in the directions specified by the repetition argument. This method returns a CanvasPattern.
API Canvas CanvasRenderingContext2D Method Reference

CanvasRenderingContext2D.createRadialGradient()

The CanvasRenderingContext2D.createRadialGradient() method of the Canvas 2D API creates a radial gradient given by the coordinates of the two circles represented by the parameters. This method returns a CanvasGradient.
API Canvas CanvasRenderingContext2D Gradients Method Reference

CanvasRenderingContext2D.currentTransform

The CanvasRenderingContext2D.currentTransform property of the Canvas 2D API returns or sets an SVGMatrix object for the current transformation matrix.
API Canvas CanvasRenderingContext2D Experimental Property

CanvasRenderingContext2D.direction

The CanvasRenderingContext2D.direction property of the Canvas 2D API specifies the current text direction used when drawing text.
API Canvas CanvasRenderingContext2D Experimental Property Reference