|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.eside.flingbox.bodies.Body
edu.eside.flingbox.bodies.Polygon
public final class Polygon
Polygon is a general class which handles the physics and render instances of a polygonal Body.
Constructor Summary | |
---|---|
Polygon()
|
|
Polygon(Vector2D[] polygonPoints)
Constructor for a Polygon |
Method Summary | |
---|---|
Vector2D[] |
getPoints()
|
short |
getPointsCount()
|
void |
onMovement(Vector2D position,
float rotation)
Called when movement occurs. |
boolean |
readXml(XmlPullParser parser)
|
void |
setPoints(Vector2D[] points,
Vector2D centroid)
|
void |
setRandomColor()
Sets random color to polygon |
boolean |
writeXml(XmlSerializer serializer)
XML Writter |
Methods inherited from class edu.eside.flingbox.bodies.Body |
---|
getPhysics, getRender |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Polygon()
public Polygon(Vector2D[] polygonPoints) throws java.lang.IllegalArgumentException
polygonPoints
- Array of Polygon's point, this is stored and modified
java.lang.IllegalArgumentException
- If not enough pointsMethod Detail |
---|
public Vector2D[] getPoints()
public void setPoints(Vector2D[] points, Vector2D centroid)
public short getPointsCount()
public void setRandomColor()
public void onMovement(Vector2D position, float rotation)
onMovement
in interface PhysicBody.OnMovementListener
position
- new body's positionpublic boolean writeXml(XmlSerializer serializer)
writeXml
in interface XmlExporter.XmlSerializable
public boolean readXml(XmlPullParser parser) throws XmlPullParserException, java.io.IOException, InvalidXmlException
readXml
in interface XmlImporter.XmlParseable
XmlPullParserException
java.io.IOException
InvalidXmlException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |