visual.dynamic.described
Class DescribedSprite
java.lang.Object
visual.dynamic.described.AbstractSprite
visual.dynamic.described.TweeningSprite
visual.dynamic.described.DescribedSprite
- All Implemented Interfaces:
- MetronomeListener, Sprite, SimpleContent, TransformableContent
public class DescribedSprite
- extends TweeningSprite
A TweeningSprite that uses described visual content
Note: This class uses a Vector of AggregateContent
objects rather than CompositeContent objects for
simplicity.
- See Also:
- "The Design and Implementation of Multimedia Software © 2011"
Method Summary |
void |
addKeyTime(int keyTime,
java.awt.geom.Point2D location,
java.lang.Double rotation,
java.lang.Double scaling,
AggregateContent ctc)
Add a key time
Note: This method does not ensure that the first key
time actually contains static visual content |
TransformableContent |
getContent()
Get the visual content associated with this Sprite
Note that the visual content created depends on the
current state of this Sprite |
protected void |
tweenShape(AggregateContent a,
AggregateContent b,
double frac)
Determine the current 'tweened shape |
Methods inherited from class visual.dynamic.described.TweeningSprite |
addKeyTime, getInterpolationFraction, getKeyTimeIndex, getNextKeyTimeIndex, handleTick, initialize, reinitialize, setEndState, tweenLocation, tweenRotation, tweenScaling |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DescribedSprite
public DescribedSprite()
- Default Constructor
addKeyTime
public void addKeyTime(int keyTime,
java.awt.geom.Point2D location,
java.lang.Double rotation,
java.lang.Double scaling,
AggregateContent ctc)
- Add a key time
Note: This method does not ensure that the first key
time actually contains static visual content
- Parameters:
keyTime
- The timelocation
- The location of the sprite at this timerotation
- The rotation of the sprite (null to align with path)scaling
- The scaling of the sprite at this timectc
- The Content to use (or null to use previous Content)
getContent
public TransformableContent getContent()
- Get the visual content associated with this Sprite
Note that the visual content created depends on the
current state of this Sprite
- Specified by:
getContent
in class AbstractSprite
- Returns:
- The transformed content
tweenShape
protected void tweenShape(AggregateContent a,
AggregateContent b,
double frac)
- Determine the current 'tweened shape
- Parameters:
a
- The first shapeb
- The second shapefrac
- The interpolation fraction
Design and Implementation of Multimedia Software, Jones and Bartlett Publishers