Reference
- Body Classes
-
Body Functions
- (PPBox)getHeight()
- (PPBox)getWidth()
- (PPBox)setSize()
- (PPCircle)getSize()
- (PPCircle)setSize()
- addExcludedBody()
- addForce()
- adjustAngularVelocity()
- adjustVelocity()
- applyMatrix()
- attachImage()
- dettachImage()
- getAngularVelocity()
- getImageAlpha()
- getRotation()
- getVelocityX()
- getVelocityY()
- getX()
- getY()
- isResting()
- isStatic()
- isTouchingBody()
- resetForces()
- setAngularVelocity()
- setDamping()
- setDrawable()
- setFillColor()
- setFriction()
- setGravityEffected()
- setImageAlpha()
- setMass()
- setPosition()
- setRestitution()
- setRotatable()
- setRotation()
- setRotDamping()
- setStaticBody()
- setStrokeColor()
- setStrokeWidth()
- setVelocity()
- World Classes
- World Fucntions
PPPoly
Description
Create a concave polygon shape. By defaults, it creates a star. Use the vertex() function to create a custom shape. When creating a basic shape, remember that the gravity center and the drawing center is the (0,0) of your shape. Also be sure that your polygon is concave and has at least 3 points.
Exemples
PPPoly myPoly1 = new PPPoly();
myPoly1.setPosition(100, 100);
myPoly1.vertex(-5, -15);
myPoly1.vertex(5, -15);
myPoly1.vertex(15, -5);
myPoly1.vertex(15, 5);
myPoly1.vertex(5, 15);
myPoly1.vertex(-5, 15);
myPoly1.vertex(-15, 5);
myPoly1.vertex(-15, -5);
world.add(myPoly1);
Syntax
PPPoly();
Parameters
none