public class SpriteAnimation extends Animation implements PathObserver
HUD_LAYER| Constructor and Description |
|---|
SpriteAnimation(SpriteManager spritemgr,
Sprite sprite,
Path path)
Constructs a sprite animation for the given sprite.
|
| Modifier and Type | Method and Description |
|---|---|
void |
paint(Graphics2D gfx)
Called by the appropriate manager to request that the media render itself with the given
graphics context.
|
void |
pathCancelled(Sprite sprite,
Path path)
Called when a sprite's path is cancelled either because a new path was started or the path
was explicitly cancelled with
Sprite.cancelMove(). |
void |
pathCompleted(Sprite sprite,
Path path,
long when)
Called when a sprite completes its traversal of a path.
|
void |
tick(long timestamp)
Called periodically by this media's manager to give it a chance to do its thing.
|
addAnimationObserver, isFinished, removeAnimationObserver, reset, setLocationcontains, contains, contains, contains, fastForward, getBounds, getBounds2D, getPathIterator, getPathIterator, getRenderOrder, init, intersects, intersects, invalidate, queueNotification, renderCompareTo, setRenderOrder, toString, viewLocationDidChangepublic SpriteAnimation(SpriteManager spritemgr, Sprite sprite, Path path)
public void tick(long timestamp)
AbstractMediatick in class AbstractMediatimestamp - a time stamp associated with this tick. Note: this is not obtained
from a call to System.currentTimeMillis() and cannot be compared to timestamps
obtained there from.public void paint(Graphics2D gfx)
AbstractMediapaint in class AbstractMediapublic void pathCancelled(Sprite sprite, Path path)
PathObserverSprite.cancelMove().pathCancelled in interface PathObserverpublic void pathCompleted(Sprite sprite, Path path, long when)
PathObserverpathCompleted in interface PathObserversprite - the sprite that completed its path.path - the path that was completed.when - the tick stamp of the media tick on which the path was completed (see
FrameManager.tick(long)) (this may not be in the same time domain as
System.currentTimeMillis()).Copyright © 2015. All rights reserved.