public class BobblePath extends Object implements Path
| Constructor and Description |
|---|
BobblePath(int dx,
int dy,
long duration)
Construct a bobble path that updates as often as possible.
|
BobblePath(int dx,
int dy,
long duration,
long updateFreq)
Construct a bobble path.
|
| Modifier and Type | Method and Description |
|---|---|
void |
fastForward(long timeDelta)
This is called if the pathable is paused for some length of time and then unpaused.
|
void |
init(Pathable pable,
long tickstamp)
Called once to let the path prepare itself for the process of animating the supplied
pathable.
|
void |
paint(Graphics2D gfx)
Paint this path on the screen (used for debugging purposes only).
|
void |
setUpdateFrequency(long freq)
Set a new update frequency.
|
void |
setVariance(int dx,
int dy)
Set the variance of bobblin' in each direction.
|
void |
stop()
Have the Pathable stop bobbling asap.
|
boolean |
tick(Pathable pable,
long tickStamp)
Called to request that this path update the position of the specified pathable based on the
supplied timestamp information.
|
void |
wasRemoved(Pathable pable)
When a path is removed from a pathable, whether that is because the path was completed or
because it was replaced by another path, this method will be called to let the path know
that it is no longer associated with this pathable.
|
public BobblePath(int dx,
int dy,
long duration)
dx - the variance in the x direction.dy - the variance in the y direction.duration - the duration to bobble, or -1 to bobble until stop() is called.public BobblePath(int dx,
int dy,
long duration,
long updateFreq)
dx - the variance in the x direction.dy - the variance in the y direction.duration - the duration to bobble, or -1 to bobble until stop() is called.updateFreq - how often to update the Pathable's location.public void setVariance(int dx,
int dy)
public void setUpdateFrequency(long freq)
public void stop()
public void init(Pathable pable, long tickstamp)
PathPath.tick(com.threerings.media.util.Pathable, long) after Path.init(com.threerings.media.util.Pathable, long) with the same
initialization timestamp.public boolean tick(Pathable pable, long tickStamp)
Pathpublic void fastForward(long timeDelta)
PathfastForward in interface Pathpublic void paint(Graphics2D gfx)
Pathpublic void wasRemoved(Pathable pable)
PathwasRemoved in interface PathCopyright © 2015. All rights reserved.