public class ChainShape extends Shape
Shape.Type
Constructor and Description |
---|
ChainShape() |
Modifier and Type | Method and Description |
---|---|
void |
createChain(float[] vertices)
Create a chain with isolated end vertices.
|
void |
createChain(float[] vertices,
int offset,
int length)
Create a chain with isolated end vertices.
|
void |
createChain(Vector2[] vertices)
Create a chain with isolated end vertices.
|
void |
createLoop(float[] vertices)
Create a loop.
|
void |
createLoop(float[] vertices,
int offset,
int length)
Create a loop.
|
void |
createLoop(Vector2[] vertices)
Create a loop.
|
Shape.Type |
getType()
Get the type of this shape.
|
void |
getVertex(int index,
Vector2 vertex)
Returns the vertex at the given position.
|
int |
getVertexCount() |
boolean |
isLooped() |
void |
setNextVertex(float nextVertexX,
float nextVertexY)
Establish connectivity to a vertex that follows the last vertex.
|
void |
setNextVertex(Vector2 nextVertex)
Establish connectivity to a vertex that follows the last vertex.
|
void |
setPrevVertex(float prevVertexX,
float prevVertexY)
Establish connectivity to a vertex that precedes the first vertex.
|
void |
setPrevVertex(Vector2 prevVertex)
Establish connectivity to a vertex that precedes the first vertex.
|
dispose, getChildCount, getRadius, jniGetType, setRadius
public Shape.Type getType()
Shape
public void createLoop(float[] vertices)
vertices
- an array of floats of alternating x, y coordinates.public void createLoop(float[] vertices, int offset, int length)
vertices
- an array of floats of alternating x, y coordinates.offset
- into the vertices arraylength
- after offset (in floats, not float-pairs, so even number)public void createLoop(Vector2[] vertices)
vertices
- an array of vertices, these are copiedpublic void createChain(float[] vertices)
vertices
- an array of floats of alternating x, y coordinates.public void createChain(float[] vertices, int offset, int length)
vertices
- an array of floats of alternating x, y coordinates.offset
- into the vertices arraylength
- after offset (in floats, not float-pairs, so even number)public void createChain(Vector2[] vertices)
vertices
- an array of vertices, these are copiedpublic void setPrevVertex(Vector2 prevVertex)
public void setPrevVertex(float prevVertexX, float prevVertexY)
public void setNextVertex(Vector2 nextVertex)
public void setNextVertex(float nextVertexX, float nextVertexY)
public int getVertexCount()
public void getVertex(int index, Vector2 vertex)
index
- the index of the vertex 0 <= index < getVertexCount( )vertex
- vertexpublic boolean isLooped()