W3cubDocs

/Haxe JavaScript

Path2D

package js.html

Available on js

The Path2D interface of the Canvas 2D API is used to declare paths that are then later used on CanvasRenderingContext2D objects. The path methods of the CanvasRenderingContext2D interface are present on this interface as well and are allowing you to create paths that you can retain and replay as required on a canvas.

Documentation Path2D by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See also:

Constructor

new(pathString:String)

new()

new(other:Path2D)

Throws:

null

DOMError

Methods

addPath(path:Path2D, ?transformation:Matrix):Void

Adds a path to the current path.

arc(x:Float, y:Float, radius:Float, startAngle:Float, endAngle:Float, anticlockwise:Bool = false):Void

Throws:

null

DOMError

arcTo(x1:Float, y1:Float, x2:Float, y2:Float, radius:Float):Void

Throws:

null

DOMError

bezierCurveTo(cp1x:Float, cp1y:Float, cp2x:Float, cp2y:Float, x:Float, y:Float):Void

closePath():Void

ellipse(x:Float, y:Float, radiusX:Float, radiusY:Float, rotation:Float, startAngle:Float, endAngle:Float, anticlockwise:Bool = false):Void

Throws:

null

DOMError

lineTo(x:Float, y:Float):Void

moveTo(x:Float, y:Float):Void

quadraticCurveTo(cpx:Float, cpy:Float, x:Float, y:Float):Void

rect(x:Float, y:Float, w:Float, h:Float):Void

© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/Path2D.html