|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttipgame.Sprite
tipgame.sprite.BlurSprite
public class BlurSprite
This class provides a mechanism for showing the path of fast moving Sprites in which it is useful to draw the position of Sprites in intermediate frames between screen refresh. The Sprites are drawn with increasing opacity with time. The opacity works only for single color Sprites. In order to make an existing Sprite display motion blur, simply extend this class instead of the Sprite class.
| Field Summary | |
|---|---|
private static int |
DEFAULT_FRAMES
the default number of previous frames to store |
private static int |
DEFAULT_PER_FRAME
the default number of Shapes to store per frame |
private int |
drawNumber
used to indicate how many Shapes have been drawn |
private int |
numFrames
the number of Shapes to store per frame |
private int |
numPerFrame
the number of previous frames to store |
private java.util.LinkedList<java.awt.Shape> |
previous
the previous Sprites as Shapes |
| Fields inherited from class tipgame.Sprite |
|---|
color, tracker |
| Constructor Summary | |
|---|---|
BlurSprite()
|
|
| Method Summary | |
|---|---|
void |
paint(java.awt.Graphics2D brush)
paints the current Sprite after painting the Sprite's previous locations in increasing opacity |
void |
setEnabled(boolean enabled)
enables the sprite blur |
void |
setHistory(int frames,
int perFrame)
updates the number of previous frames to store and how many Shapes to store per frame |
void |
update(double time)
adds to the list of previous Shapes |
| Methods inherited from class tipgame.Sprite |
|---|
flipAlongHorizontalAxis, flipAlongVerticalAxis, getBounds2D, getColor, getLocation, getNormalVector, getRotation, getScale, getShape, getTracker, getUseBoundingBox, intersects, isDestroyed, isEnabled, isVisible, kill, normalize, paintInternal, rotate, scale, setColor, setLocation, setLocation, setRotation, setScale, setShape, setTracker, setUseBoundingBox, setVisible, translate, updateInternal |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.util.LinkedList<java.awt.Shape> previous
private static int DEFAULT_PER_FRAME
private static int DEFAULT_FRAMES
private int numFrames
private int numPerFrame
private int drawNumber
| Constructor Detail |
|---|
public BlurSprite()
| Method Detail |
|---|
public void setEnabled(boolean enabled)
setEnabled in class Spriteenabled - true indicates the Sprite can display and update, false
otherwiseSprite.setEnabled(boolean)
public void setHistory(int frames,
int perFrame)
frames - the number of previous frames to storeperFrame - the number of Shapes per framepublic void update(double time)
update in class Spritetipgame.Sprite#update()public void paint(java.awt.Graphics2D brush)
paint in class Spritebrush - the Graphics used to draw the shapeSprite.paint(java.awt.Graphics2D)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||