vooga.gameEngine.graphics
Class ShapeTexture

java.lang.Object
  extended by vooga.gameEngine.graphics.Texture
      extended by vooga.gameEngine.graphics.ShapeTexture
All Implemented Interfaces:
java.io.Serializable

public class ShapeTexture
extends Texture

Class ShapeTexture represents a shape that can be rendered on screen. Any shape supported by Java can be used. The dimension and position of the shape will be extracted.

Author:
Justin C. Klaassen
See Also:
Serialized Form

Constructor Summary
ShapeTexture(java.awt.Shape s, java.awt.Color fillColor)
          Creates a new ShapeTexture from given shape with a specified fill color.
 
Method Summary
 void createShape(java.awt.Shape s)
          Sets the representation of this Texture to the specified shape.
protected  java.awt.Shape makeShape()
          Method for a Texture subclass to supply a Shape representing their bounding box.
 void setFillColor(java.awt.Color fillColor)
          Sets the color that will be used to fill the shape.
 void setShape(java.awt.Shape s)
           
 
Methods inherited from class vooga.gameEngine.graphics.Texture
getArea, getIndex, getPosition, getRotation, getShape, getSize, paintComponent, setImage, setIndex, setPosition, setRotation, setSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapeTexture

public ShapeTexture(java.awt.Shape s,
                    java.awt.Color fillColor)
Creates a new ShapeTexture from given shape with a specified fill color.

Parameters:
s - is the Shape to be rendered
fillColor - is the color that will be used to fill the shape
Method Detail

createShape

public void createShape(java.awt.Shape s)
Sets the representation of this Texture to the specified shape. The dimensions and position of this Texture will be extracted from the shape.

Parameters:
s - is the Shape to be rendered

setShape

public void setShape(java.awt.Shape s)

setFillColor

public void setFillColor(java.awt.Color fillColor)
Sets the color that will be used to fill the shape.

Parameters:
fillColor - is the color that will be used to fill the shape

makeShape

protected java.awt.Shape makeShape()
Description copied from class: Texture
Method for a Texture subclass to supply a Shape representing their bounding box. For efficiency, an object should cache their Shape if possible.

Specified by:
makeShape in class Texture
Returns:
a Shape representing the boundaries of the object