|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.gameEngine.graphics.Texture
public abstract class Texture
Super class for rendering an image that will represent a
GameItem
on screen.
Constructor Summary | |
---|---|
protected |
Texture()
Protected constructor for subclasses; creates a new Texture
object with default constructors for a Dimension ,
Position , and Rotation2D . |
Method Summary | |
---|---|
java.awt.geom.Area |
getArea()
Method for getting the area occupied by this Texture in
terms of the game's coordinate system. |
int |
getIndex()
Method for getting the rendering index associated with this Texture . |
Position |
getPosition()
Method for getting the position of this texture in terms of the game's coordinate system. |
Rotation2D |
getRotation()
Method for getting the rotation of this texture in terms of the game's coordinate system. |
java.awt.Shape |
getShape()
Method for getting a shape representing the convex outline associated with this Texture . |
Dimension |
getSize()
Method for getting the size of this texture in terms of the game's coordinate system. |
protected abstract java.awt.Shape |
makeShape()
Method for a Texture subclass to supply a Shape
representing their bounding box. |
void |
paintComponent(java.awt.Graphics2D g2d,
double scalefactor)
Paints this component on the provided Graphics object. |
protected void |
setImage(java.awt.image.BufferedImage image)
Method for subclasses to change the image used to represent this Texture on screen. |
void |
setIndex(int index)
Method for setting the rendering index associated with this Texture . |
void |
setPosition(Position p)
Sets the position of the game object relative to the game's coordinate system. |
void |
setRotation(Rotation2D r)
Sets the rotation of the game object relative to the game's coordinate system. |
void |
setSize(Dimension d)
Sets the specified Dimension , d, as this
Texture 's size. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Texture()
Texture
object with default constructors for a Dimension
,
Position
, and Rotation2D
. The index is also defaulted to
0.
Method Detail |
---|
protected void setImage(java.awt.image.BufferedImage image)
Texture
on screen. Calculates the convex outline of the
image when called.
image
- to be usedpublic void setSize(Dimension d)
Dimension
, d, as this
Texture
's size.
d
- is the dimension of this game object in the game coordinate
systempublic Dimension getSize()
Dimension
associated with this texturepublic void setPosition(Position p)
p
- is the Position
to be set from the top left
cornerpublic Position getPosition()
Position
associated with this texturepublic void setRotation(Rotation2D r)
r
- is the Rotation2D
to be setpublic Rotation2D getRotation()
Rotation2D
associated with this
texturepublic void setIndex(int index)
Texture
. Objects are rendered on screen from highest to
lowest index values.
index
- to be setpublic int getIndex()
Texture
. Objects are rendered on screen from highest to
lowest index values.
Texture
public java.awt.Shape getShape()
Texture
.
Texture
protected abstract java.awt.Shape makeShape()
Texture
subclass to supply a Shape
representing their bounding box. For efficiency, an object should cache
their Shape
if possible.
Shape
representing the boundaries of the objectpublic java.awt.geom.Area getArea()
Texture
in
terms of the game's coordinate system. Useful for collision detection.
Texture
public void paintComponent(java.awt.Graphics2D g2d, double scalefactor)
Graphics
object.
g2d
- is the Graphics2D
representing the game
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |