|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.geom.Shape org.newdawn.slick.geom.Path
public class Path
A shape built from lines and curves. Hole support is present but restricted.
Field Summary |
---|
Fields inherited from class org.newdawn.slick.geom.Shape |
---|
boundingCircleRadius, center, maxX, maxY, minX, minY, points, pointsDirty, trianglesDirty, tris, x, y |
Constructor Summary | |
---|---|
Path(float sx,
float sy)
Create a new path |
Method Summary | |
---|---|
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. |
Methods inherited from class org.newdawn.slick.geom.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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Path(float sx, float sy)
sx
- The start x coordinate of the pathsy
- The start y coordiante of the pathMethod Detail |
---|
public 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
Shape.createPoints()
public Shape transform(Transform transform)
Shape
transform
in class Shape
transform
- The transform to be applied
Shape.transform(org.newdawn.slick.geom.Transform)
public boolean closed()
closed
in class Shape
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |