|
@@ -12,7 +12,8 @@
|
|
|
<h1>[name]</h1>
|
|
|
|
|
|
<p class="desc">
|
|
|
- A 2D path representation. The class provides methods for creating paths and contours of 2D shapes similar to the 2D Canvas API.
|
|
|
+ A 2D path representation. The class provides methods for creating paths
|
|
|
+ and contours of 2D shapes similar to the 2D Canvas API.
|
|
|
</p>
|
|
|
|
|
|
<h2>Code Example</h2>
|
|
@@ -33,28 +34,28 @@
|
|
|
scene.add( line );
|
|
|
</code>
|
|
|
|
|
|
-
|
|
|
<h2>Constructor</h2>
|
|
|
|
|
|
-
|
|
|
<h3>[name]( [param:Array points] )</h3>
|
|
|
<p>
|
|
|
- points -- (optional) array of [page:Vector2 Vector2s].<br /><br />
|
|
|
+ points -- (optional) array of [page:Vector2 Vector2s].<br /><br />
|
|
|
|
|
|
- Creates a Path from the points. The first point defines the offset, then successive points
|
|
|
- are added to the [page:CurvePath.curves curves] array as [page:LineCurve LineCurves].<br /><br />
|
|
|
+ Creates a Path from the points. The first point defines the offset, then
|
|
|
+ successive points are added to the [page:CurvePath.curves curves] array as
|
|
|
+ [page:LineCurve LineCurves].<br /><br />
|
|
|
|
|
|
- If no points are specified, an empty path is created and the [page:.currentPoint] is set to
|
|
|
- the origin.
|
|
|
+ If no points are specified, an empty path is created and the
|
|
|
+ [page:.currentPoint] is set to the origin.
|
|
|
</p>
|
|
|
|
|
|
-
|
|
|
<h2>Properties</h2>
|
|
|
<p>See the base [page:CurvePath] class for common properties.</p>
|
|
|
|
|
|
<h3>[property:Vector2 currentPoint]</h3>
|
|
|
- <p>The current offset of the path. Any new [page:Curve] added will start here.</p>
|
|
|
-
|
|
|
+ <p>
|
|
|
+ The current offset of the path. Any new [page:Curve] added will start
|
|
|
+ here.
|
|
|
+ </p>
|
|
|
|
|
|
<h2>Methods</h2>
|
|
|
<p>See the base [page:CurvePath] class for common methods.</p>
|
|
@@ -67,7 +68,8 @@
|
|
|
endAngle -- The end angle in radians.<br />
|
|
|
clockwise -- Sweep the arc clockwise. Defaults to `false`.<br /><br />
|
|
|
|
|
|
- Adds an absolutely positioned [page:EllipseCurve EllipseCurve] to the path.
|
|
|
+ Adds an absolutely positioned [page:EllipseCurve EllipseCurve] to the
|
|
|
+ path.
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:this absellipse]( [param:Float x], [param:Float y], [param:Float xRadius], [param:Float yRadius], [param:Float startAngle], [param:Float endAngle], [param:Boolean clockwise], [param:Float rotation] )</h3>
|
|
@@ -78,25 +80,31 @@
|
|
|
startAngle -- The start angle in radians.<br />
|
|
|
endAngle -- The end angle in radians.<br />
|
|
|
clockwise -- Sweep the ellipse clockwise. Defaults to false.<br />
|
|
|
- rotation -- The rotation angle of the ellipse in radians, counterclockwise from the positive X axis. Optional, defaults to 0.<br /><br />
|
|
|
+ rotation -- The rotation angle of the ellipse in radians, counterclockwise
|
|
|
+ from the positive X axis. Optional, defaults to 0.<br /><br />
|
|
|
|
|
|
- Adds an absolutely positioned [page:EllipseCurve EllipseCurve] to the path.
|
|
|
+ Adds an absolutely positioned [page:EllipseCurve EllipseCurve] to the
|
|
|
+ path.
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:this arc]( [param:Float x], [param:Float y], [param:Float radius], [param:Float startAngle], [param:Float endAngle], [param:Boolean clockwise] )</h3>
|
|
|
<p>
|
|
|
- x, y -- The center of the arc offset from the last call.<br />
|
|
|
- radius -- The radius of the arc.<br />
|
|
|
- startAngle -- The start angle in radians.<br />
|
|
|
- endAngle -- The end angle in radians.<br />
|
|
|
- clockwise -- Sweep the arc clockwise. Defaults to `false`.<br /><br />
|
|
|
+ x, y -- The center of the arc offset from the last call.<br />
|
|
|
+ radius -- The radius of the arc.<br />
|
|
|
+ startAngle -- The start angle in radians.<br />
|
|
|
+ endAngle -- The end angle in radians.<br />
|
|
|
+ clockwise -- Sweep the arc clockwise. Defaults to `false`.<br /><br />
|
|
|
|
|
|
- Adds an [page:EllipseCurve EllipseCurve] to the path, positioned relative to [page:.currentPoint].
|
|
|
+ Adds an [page:EllipseCurve EllipseCurve] to the path, positioned relative
|
|
|
+ to [page:.currentPoint].
|
|
|
</p>
|
|
|
|
|
|
-
|
|
|
<h3>[method:this bezierCurveTo]( [param:Float cp1X], [param:Float cp1Y], [param:Float cp2X], [param:Float cp2Y], [param:Float x], [param:Float y] )</h3>
|
|
|
- <p>This creates a bezier curve from [page:.currentPoint] with (cp1X, cp1Y) and (cp2X, cp2Y) as control points and updates [page:.currentPoint] to x and y.</p>
|
|
|
+ <p>
|
|
|
+ This creates a bezier curve from [page:.currentPoint] with (cp1X, cp1Y)
|
|
|
+ and (cp2X, cp2Y) as control points and updates [page:.currentPoint] to x
|
|
|
+ and y.
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[method:this ellipse]( [param:Float x], [param:Float y], [param:Float xRadius], [param:Float yRadius], [param:Float startAngle], [param:Float endAngle], [param:Boolean clockwise], [param:Float rotation] )</h3>
|
|
|
<p>
|
|
@@ -106,31 +114,37 @@
|
|
|
startAngle -- The start angle in radians.<br />
|
|
|
endAngle -- The end angle in radians.<br />
|
|
|
clockwise -- Sweep the ellipse clockwise. Defaults to `false`.<br />
|
|
|
- rotation -- The rotation angle of the ellipse in radians, counterclockwise from the positive X axis. Optional, defaults to `0`.<br /><br />
|
|
|
+ rotation -- The rotation angle of the ellipse in radians, counterclockwise
|
|
|
+ from the positive X axis. Optional, defaults to `0`.<br /><br />
|
|
|
|
|
|
- Adds an [page:EllipseCurve EllipseCurve] to the path, positioned relative to [page:.currentPoint].
|
|
|
+ Adds an [page:EllipseCurve EllipseCurve] to the path, positioned relative
|
|
|
+ to [page:.currentPoint].
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:this lineTo]( [param:Float x], [param:Float y] )</h3>
|
|
|
- <p>Connects a [page:LineCurve] from [page:.currentPoint] to x, y onto the path.</p>
|
|
|
-
|
|
|
+ <p>
|
|
|
+ Connects a [page:LineCurve] from [page:.currentPoint] to x, y onto the
|
|
|
+ path.
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[method:this moveTo]( [param:Float x], [param:Float y] )</h3>
|
|
|
<p>Move the [page:.currentPoint] to x, y.</p>
|
|
|
|
|
|
-
|
|
|
<h3>[method:this quadraticCurveTo]( [param:Float cpX], [param:Float cpY], [param:Float x], [param:Float y] )</h3>
|
|
|
- <p>Creates a quadratic curve from [page:.currentPoint] with cpX and cpY as control point and updates [page:.currentPoint] to x and y.</p>
|
|
|
+ <p>
|
|
|
+ Creates a quadratic curve from [page:.currentPoint] with cpX and cpY as
|
|
|
+ control point and updates [page:.currentPoint] to x and y.
|
|
|
+ </p>
|
|
|
|
|
|
<h3>[method:this setFromPoints]( [param:Array vector2s] )</h3>
|
|
|
<p>
|
|
|
- points -- array of [page:Vector2 Vector2s].<br /><br />
|
|
|
+ points -- array of [page:Vector2 Vector2s].<br /><br />
|
|
|
|
|
|
- Points are added to the [page:CurvePath.curves curves]
|
|
|
- array as [page:LineCurve LineCurves].
|
|
|
+ Points are added to the [page:CurvePath.curves curves] array as
|
|
|
+ [page:LineCurve LineCurves].
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:this splineThru] ( [param:Array points] ) </h3>
|
|
|
+ <h3>[method:this splineThru] ( [param:Array points] )</h3>
|
|
|
<p>
|
|
|
points - An array of [page:Vector2 Vector2s]<br /><br />
|
|
|
|