visual.dynamic.described
Class SampledSprite

java.lang.Object
  extended by visual.dynamic.described.AbstractSprite
      extended by visual.dynamic.described.TweeningSprite
          extended by visual.dynamic.described.SampledSprite
All Implemented Interfaces:
MetronomeListener, Sprite, SimpleContent, TransformableContent

public class SampledSprite
extends TweeningSprite

A TweeningSprite that uses sampled visual content Note: This class uses a Vector of Content objects rather than a CompositeContent object for efficiency reasons.

See Also:
"The Design and Implementation of Multimedia Software © 2011"

Field Summary
 
Fields inherited from class visual.dynamic.described.TweeningSprite
keyTimes, locations, REMAIN, REMOVE, rotations, scalings
 
Fields inherited from class visual.dynamic.described.AbstractSprite
angle, rotationPoint, rotationX, rotationY, scaleX, scaleY, visible, x, y
 
Constructor Summary
SampledSprite()
          Default Constructor
 
Method Summary
 void addKeyTime(int keyTime, java.awt.geom.Point2D location, java.lang.Double rotation, java.lang.Double scaling, Content c)
          Add a key time Note: This method does not ensure that the first key frame actually contains an image.
protected  TransformableContent getContent()
          Get the visual content (based on this Sprite's current state)
 
Methods inherited from class visual.dynamic.described.TweeningSprite
addKeyTime, getInterpolationFraction, getKeyTimeIndex, getNextKeyTimeIndex, handleTick, initialize, reinitialize, setEndState, tweenLocation, tweenRotation, tweenScaling
 
Methods inherited from class visual.dynamic.described.AbstractSprite
getBounds2D, getBounds2D, intersects, render, setLocation, setRotation, setRotation, setScale, setScale, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampledSprite

public SampledSprite()
Default Constructor

Method Detail

addKeyTime

public void addKeyTime(int keyTime,
                       java.awt.geom.Point2D location,
                       java.lang.Double rotation,
                       java.lang.Double scaling,
                       Content c)
Add a key time Note: This method does not ensure that the first key frame actually contains an image.

Parameters:
keyTime - The time
location - The location of the sprite at this time
rotation - The rotation of the sprite (null to align with path)
scaling - The scaling of the sprite at this time
c - The Content to use (or null to use previous)

getContent

protected TransformableContent getContent()
Get the visual content (based on this Sprite's current state)

Specified by:
getContent in class AbstractSprite


Design and Implementation of Multimedia Software, Jones and Bartlett Publishers