Packages

class Path2D extends Object

The Path2D interface of the Canvas 2D API is used to declare a path that can then be used on a CanvasRenderingContext2D object. The path methods of the CanvasRenderingContext2D interface are also present on this interface, which gives you the convenience of being able to retain and replay your path whenever desired.

Annotations
@JSType() @native() @JSGlobal()
Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Path2D
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Path2D()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addPath(path: Path2D): Unit

    Adds a path to the current path.

  5. def arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double): Unit

    The arc() method creates a circular arc centered at (x, y) with a radius of radius.

    The arc() method creates a circular arc centered at (x, y) with a radius of radius. The path starts at startAngle, ends at endAngle, and travels in the direction given by counterclockwise (defaulting to clockwise).

  6. def arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, counterclockwise: Boolean): Unit

    The arc() method creates a circular arc centered at (x, y) with a radius of radius.

    The arc() method creates a circular arc centered at (x, y) with a radius of radius. The path starts at startAngle, ends at endAngle, and travels in the direction given by counterclockwise (defaulting to clockwise).

  7. def arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double): Unit

    Adds a circular arc to the path with the given control points and radius, connected to the previous point by a straight line.

  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double): Unit

    Adds a cubic Bézier curve to the path.

    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.

  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  11. def closePath(): Unit

    Causes the point of the pen to move back to the start of the current sub-path.

    Causes the point of the pen to move back to the start of the current sub-path. It 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.

  12. def ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, counterclockwise: Boolean = js.native): Unit

    The ellipse() method creates an elliptical arc centered at (x, y) with the radii radiusX and radiusY.

    The ellipse() method creates an elliptical arc centered at (x, y) with the radii radiusX and radiusY. The path starts at startAngle and ends at endAngle, and travels in the direction given by counterclockwise (defaulting to clockwise).

  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  21. def lineTo(x: Double, y: Double): Unit

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

  22. def moveTo(x: Double, y: Double): Unit

    Moves the starting point of a new sub-path to the (x, y) coordinates.

  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  27. def quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double): Unit

    Adds a quadratic Bézier curve to the current path.

  28. def rect(x: Double, y: Double, w: Double, h: Double): Unit

    Creates a path for a rectangle at position (x, y) with a size that is determined by width and height.

  29. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  30. def toLocaleString(): String
    Definition Classes
    Object
  31. def toString(): String
    Definition Classes
    AnyRef → Any
  32. def valueOf(): Any
    Definition Classes
    Object
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped