fang
Class PolygonSprite

java.lang.Object
  extended by fang.Sprite
      extended by fang.PolygonSprite

public class PolygonSprite
extends Sprite

This class makes a polygon shaped sprite.

Author:
Jam Jenkins

Field Summary
 
Fields inherited from class fang.Sprite
color, config, DEBUG_BOUNDING_BOX, DEBUG_INTERSECTS, debugBoundingBoxColor, image, optimizeForBitmap, shape, tracker, transform
 
Constructor Summary
PolygonSprite(double... points)
          make a sprite with a shape determined by the given vertexes.
PolygonSprite(int sides)
          makes a regular polygon with a given number of sides.
 
Method Summary
 
Methods inherited from class fang.Sprite
addTransformer, advanceTime, bounceOffOf, disableTransformer, drawDebugShapes, enableTransformer, forward, getBlurLength, getBounds2D, getColor, getDebug, getDebugBoundingBoxColor, getDefaultColor, getHeight, getLocation, getMaxX, getMaxY, getMinX, getMinY, getNormalVector, getNormalVector, getOptimizedForBitmap, getOrientation, getOrientationDegrees, getOrientationRadians, getOrientationRevolutions, getRotation, getRotationDegrees, getRotationRadians, getRotationRevolutions, getScale, getShape, getSize, getTracker, getUseBoundingBox, getWidth, getX, getY, hasTracker, hide, intersects, intersects, intersects, intersects, intersects, isDestroyed, isEnabled, isVisible, normalize, paint, paintInternal, paintShape, removeAllTrackers, removeFromCanvas, removeTransformer, rotate, rotateDegrees, rotateRadians, rotateRevolutions, scale, setAbsoluteShape, setBlurLength, setColor, setDebug, setDebugBoundingBoxColor, setDebugBrush, setDefaultColor, setEnabled, setLocation, setLocation, setLocation, setOptimizedForBitmap, setOrientation, setOrientationDegrees, setOrientationRadians, setOrientationRevolutions, setRotation, setRotationDegrees, setRotationRadians, setRotationRevolutions, setScale, setShape, setSize, setTracker, setUseBoundingBox, setVisible, setX, setY, show, translate, translate, translate, translateX, translateY, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolygonSprite

public PolygonSprite(double... points)
make a sprite with a shape determined by the given vertexes. The number of arguments sent to this method must be even because each pair of values represent the x and y for the next vertex. At least three points must be supplied. To make a square, you could send in the following points: 0, 0, 1, 0, 1, 1, 1, 0 which represent the four corners of a square: (0, 0) (1, 0) (1, 1) and (1, 0). The order in which the points are given is the order in which the lines will be drawn.

Parameters:
points - the x,y pairs for the vertexes of the polygon. The order of the points matters and determines the order of the lines drawn to connect the edges of the polygon.

PolygonSprite

public PolygonSprite(int sides)
makes a regular polygon with a given number of sides.

Parameters:
sides - number of sides of the polygon