public class Path extends Shape
boundingCircleRadius, center, maxX, maxY, minX, minY, points, pointsDirty, trianglesDirty, tris, x, y
Constructor and Description |
---|
Path(float sx,
float sy)
Create a new path
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the path to form a polygon
|
boolean |
closed()
True if this is a closed shape
|
protected void |
createPoints()
Subclasses implement this to create the points of the shape.
|
void |
curveTo(float x,
float y,
float cx1,
float cy1,
float cx2,
float cy2)
Add a curve to the specified location (using the default segments 10)
|
void |
curveTo(float x,
float y,
float cx1,
float cy1,
float cx2,
float cy2,
int segments)
Add a curve to the specified location (specifing the number of segments)
|
void |
lineTo(float x,
float y)
Add a line to the contour or hole which ends at the specified
location.
|
void |
startHole(float sx,
float sy)
Start building a hole in the previously defined contour
|
Shape |
transform(Transform transform)
Apply a transformation and return a new shape.
|
calculateRadius, calculateTriangles, checkPoints, contains, contains, findCenter, getBoundingCircleRadius, getCenter, getCenterX, getCenterY, getHeight, getLocation, getMaxX, getMaxY, getMinX, getMinY, getNormal, getPoint, getPointCount, getPoints, getTriangles, getWidth, getX, getY, hasVertex, includes, increaseTriangulation, indexOf, intersects, preCache, prune, setCenterX, setCenterY, setLocation, setLocation, setX, setY, subtract, union
public Path(float sx, float sy)
sx
- The start x coordinate of the pathsy
- The start y coordiante of the pathpublic void startHole(float sx, float sy)
sx
- The start point of the holesy
- The start point of the holepublic void lineTo(float x, float y)
x
- The x coordinate to draw the line toy
- The y coordiante to draw the line topublic void close()
public void curveTo(float x, float y, float cx1, float cy1, float cx2, float cy2)
x
- The destination x coordinatey
- The destination y coordiantecx1
- The x coordiante of the first control pointcy1
- The y coordiante of the first control pointcx2
- The x coordinate of the second control pointcy2
- The y coordinate of the second control pointpublic void curveTo(float x, float y, float cx1, float cy1, float cx2, float cy2, int segments)
x
- The destination x coordinatey
- The destination y coordiantecx1
- The x coordiante of the first control pointcy1
- The y coordiante of the first control pointcx2
- The x coordinate of the second control pointcy2
- The y coordinate of the second control pointsegments
- The number of segments to use for the new curveprotected void createPoints()
Shape
createPoints
in class Shape
public Shape transform(Transform transform)
Shape