fang
Class PieSprite

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

public class PieSprite
extends Sprite

This class represents a wedge of pie as a Sprite. This arc is defined as part of a full oval by a start and end angle around the oval. The angles are specified such that 45 degrees falls halfway up between the width and height ratio of the oval. The arc sweeps around counter-clockwise from the start angle to the end angle. For example, given 0 and 180 as the start and end angles, defines an arc over the top half of the oval; but given 180 and 0 as the start and end angles, defines an arc over the bottom half of the oval. The arc is enclosed by drawing a straight line from the start of the arc segment to the center of the defining oval and from there to end of the arc segment (like a slice of pie).

Author:
Robert Duvall

Field Summary
 
Fields inherited from class fang.Sprite
color, config, DEBUG_BOUNDING_BOX, DEBUG_INTERSECTS, debugBoundingBoxColor, image, optimizeForBitmap, shape, tracker, transform
 
Constructor Summary
PieSprite(double start, double end)
          Makes a Sprite that looks like a circular wedge of pie, i.e., its width and height ratio is 1:1, that goes from the given start angle to the given end angle.
PieSprite(double width, double height, double start, double end)
          Makes a Sprite that looks like a wedge of pie that goes from the given start angle to the given end angle, on an oval proportioned according to the given width and height ratio.
 
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

PieSprite

public PieSprite(double start,
                 double end)
Makes a Sprite that looks like a circular wedge of pie, i.e., its width and height ratio is 1:1, that goes from the given start angle to the given end angle.

Parameters:
start - beginning angle in degrees of the arc
end - ending angle in degrees of the arc

PieSprite

public PieSprite(double width,
                 double height,
                 double start,
                 double end)
Makes a Sprite that looks like a wedge of pie that goes from the given start angle to the given end angle, on an oval proportioned according to the given width and height ratio. The magnitude of the width and height only matter with respect to each other. For example, a Sprite constructed with a width 2 and height 1 is the same as making the width 20 and the height 10 because they both have the same height/width aspect ratio of 2.

Parameters:
width - width scale of the rectangle
height - height scale of the rectangle
start - beginning angle in degrees of the arc
end - ending angle in degrees of the arc