|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.AbstractMedia
com.threerings.media.animation.Animation
com.threerings.media.animation.FloatingTextAnimation
public class FloatingTextAnimation
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.media.animation.Animation |
|---|
Animation.AnimCompletedOp, Animation.AnimStartedOp |
| Field Summary | |
|---|---|
protected float |
_alpha
The current alpha level used to render the score. |
protected Composite |
_comp
The composite used to render the score. |
protected int |
_destx
The destination coordinates towards which the animation travels. |
protected int |
_desty
The destination coordinates towards which the animation travels. |
protected int |
_dx
The distance to be traveled by the score animation. |
protected int |
_dy
The distance to be traveled by the score animation. |
protected long |
_floatPeriod
The duration for which we float up the screen. |
protected Label |
_label
The label we're animating. |
protected long |
_start
The starting animation time. |
protected int |
_startX
The starting coordinates of the score. |
protected int |
_startY
The starting coordinates of the score. |
protected int |
_x
The current coordinates of the score. |
protected int |
_y
The current coordinates of the score. |
protected static long |
DEFAULT_FLOAT_PERIOD
The time in milliseconds during which the score is visible. |
protected static int |
DELTA_Y
The total vertical distance the score travels. |
| Fields inherited from class com.threerings.media.animation.Animation |
|---|
_finished |
| Fields inherited from class com.threerings.media.AbstractMedia |
|---|
_bounds, _firstTick, _mgr, _observers, _renderOrder, HUD_LAYER |
| Constructor Summary | |
|---|---|
FloatingTextAnimation(Label label,
int x,
int y)
Constructs an animation for the given text centered at the given coordinates. |
|
FloatingTextAnimation(Label label,
int sx,
int sy,
int destx,
int desty,
long floatPeriod)
Constructs an animation for the given text starting at the given coordinates and floating toward the specified coordinates. |
|
FloatingTextAnimation(Label label,
int x,
int y,
long floatPeriod)
Constructs an animation for the given text centered at the given coordinates. |
|
| Method Summary | |
|---|---|
void |
fastForward(long timeDelta)
Called when the appropriate media manager has been paused for some length of time and is then unpaused. |
void |
flipDirection()
Called to change the direction 180 degrees. |
Label |
getLabel()
Returns the label used to render this score animation. |
void |
paint(Graphics2D gfx)
Called by the appropriate manager to request that the media render itself with the given graphics context. |
protected void |
paintLabels(Graphics2D gfx,
int x,
int y)
Derived classes may wish to extend score animation and render more than just the standard single label. |
void |
setFloatPeriod(long floatPeriod)
Sets the duration of this score animation to the specified time in milliseconds. |
void |
setLocation(int x,
int y)
Set the location. |
void |
tick(long timestamp)
Called periodically by this media's manager to give it a chance to do its thing. |
protected void |
toString(StringBuilder buf)
This should be overridden by derived classes (which should be sure to call super.toString()) to append the derived class
specific information to the string buffer. |
| Methods inherited from class com.threerings.media.animation.Animation |
|---|
addAnimationObserver, didFinish, isFinished, removeAnimationObserver, reset, willFinish, willStart |
| Methods inherited from class com.threerings.media.AbstractMedia |
|---|
addObserver, contains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, getRenderOrder, init, init, intersects, intersects, invalidate, invalidateAfterChange, naturalCompareTo, queueNotification, removeObserver, renderCompareTo, setRenderOrder, shutdown, toString, viewLocationDidChange |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected long _start
protected Label _label
protected int _startX
protected int _startY
protected int _x
protected int _y
protected int _destx
protected int _desty
protected int _dx
protected int _dy
protected long _floatPeriod
protected float _alpha
protected Composite _comp
protected static final long DEFAULT_FLOAT_PERIOD
protected static final int DELTA_Y
| Constructor Detail |
|---|
public FloatingTextAnimation(Label label,
int x,
int y)
public FloatingTextAnimation(Label label,
int x,
int y,
long floatPeriod)
public FloatingTextAnimation(Label label,
int sx,
int sy,
int destx,
int desty,
long floatPeriod)
| Method Detail |
|---|
public void flipDirection()
public Label getLabel()
public void setLocation(int x,
int y)
AbstractMedia
setLocation in class Animationpublic void setFloatPeriod(long floatPeriod)
public void tick(long timestamp)
AbstractMedia
tick 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 fastForward(long timeDelta)
AbstractMedia
fastForward in class AbstractMediapublic void paint(Graphics2D gfx)
AbstractMedia
paint in class AbstractMedia
protected void paintLabels(Graphics2D gfx,
int x,
int y)
x - the upper left coordinate of the animation.y - the upper left coordinate of the animation.protected void toString(StringBuilder buf)
AbstractMediasuper.toString()) to append the derived class
specific information to the string buffer.
toString in class AbstractMedia
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||