|
|||||||||
| 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.ExplodeAnimation
public class ExplodeAnimation
An animation that displays an object exploding into chunks, fading out as they fly apart. The animation ends when all chunks have exited the animation bounds, or when the given delay time (if any is specified) has elapsed.
| Nested Class Summary | |
|---|---|
static class |
ExplodeAnimation.ExplodeInfo
A class that describes an explosion's attributes. |
| Nested classes/interfaces inherited from class com.threerings.media.animation.Animation |
|---|
Animation.AnimCompletedOp, Animation.AnimStartedOp |
| Field Summary | |
|---|---|
protected float |
_alpha
The percent alpha with which to render the chunks. |
protected float |
_angle
The current chunk rotation. |
protected int |
_chei
The individual chunk dimensions in pixels. |
protected int |
_chunkcount
The total number of image chunks. |
protected Color |
_color
The color to render the object chunks in if we're using a color. |
protected int |
_cwid
The individual chunk dimensions in pixels. |
protected int[] |
_cxpos
The current x-axis position of each chunk. |
protected int[] |
_cypos
The current y-axis position of each chunk. |
protected long |
_end
The ending animation time. |
protected int |
_hchei
The individual chunk dimensions in pixels, halved for handy use in repeated calculations. |
protected int |
_hcwid
The individual chunk dimensions in pixels, halved for handy use in repeated calculations. |
protected Mirage |
_image
The image to animate if we're using an image. |
protected ExplodeAnimation.ExplodeInfo |
_info
The explode info. |
protected int |
_ohei
The exploding object position and dimensions. |
protected int |
_owid
The exploding object position and dimensions. |
protected int |
_ox
The exploding object position and dimensions. |
protected int |
_oy
The exploding object position and dimensions. |
protected long |
_start
The starting animation time. |
protected float[] |
_sxvel
The starting x-axis velocity of each chunk. |
protected float[] |
_syvel
The starting y-axis velocity of each chunk. |
protected Rectangle |
_wrect
A reusable working rectangle. |
| 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 | |
|---|---|
ExplodeAnimation(Color color,
ExplodeAnimation.ExplodeInfo info,
int x,
int y,
int width,
int height)
Constructs an explode animation with the chunks represented as filled rectangles of the specified color. |
|
ExplodeAnimation(Mirage image,
ExplodeAnimation.ExplodeInfo info,
int x,
int y,
int width,
int height)
Constructs an explode animation with the chunks represented as portions of the actual image. |
|
| Method Summary | |
|---|---|
void |
fastForward(long timeDelta)
Called when the appropriate media manager has been paused for some length of time and is then unpaused. |
protected void |
init(ExplodeAnimation.ExplodeInfo info,
int x,
int y,
int width,
int height)
Initializes the animation with the attributes of the given explode info object. |
void |
paint(Graphics2D gfx)
Called by the appropriate manager to request that the media render itself with the given graphics context. |
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, setLocation, 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 float _angle
protected float[] _sxvel
protected float[] _syvel
protected int[] _cxpos
protected int[] _cypos
protected int _cwid
protected int _chei
protected int _hcwid
protected int _hchei
protected int _chunkcount
protected ExplodeAnimation.ExplodeInfo _info
protected int _ox
protected int _oy
protected int _owid
protected int _ohei
protected Color _color
protected Mirage _image
protected long _start
protected long _end
protected float _alpha
protected Rectangle _wrect
| Constructor Detail |
|---|
public ExplodeAnimation(Color color,
ExplodeAnimation.ExplodeInfo info,
int x,
int y,
int width,
int height)
color - the color to render the chunks in.info - the explode info object.x - the x-position of the object.y - the y-position of the object.width - the width of the object.height - the height of the object.
public ExplodeAnimation(Mirage image,
ExplodeAnimation.ExplodeInfo info,
int x,
int y,
int width,
int height)
image - the image to animate.info - the explode info object.x - the x-position of the object.y - the y-position of the object.width - the width of the object.height - the height of the object.| Method Detail |
|---|
protected void init(ExplodeAnimation.ExplodeInfo info,
int x,
int y,
int width,
int height)
public void fastForward(long timeDelta)
AbstractMedia
fastForward in class AbstractMediapublic 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 paint(Graphics2D gfx)
AbstractMedia
paint in class AbstractMediaprotected 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 | ||||||||