|
|||||||||
| 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.ScaleAnimation
public class ScaleAnimation
Animates an image changing size about its center point.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.media.animation.Animation |
|---|
Animation.AnimCompletedOp, Animation.AnimStartedOp |
| Field Summary | |
|---|---|
protected BufferedImage |
_bufferedImage
The image converted to a format Graphics2D likes, and cached. |
protected Point |
_center
The center pixel to render the image around. |
protected float |
_endScale
The amount to scale the image at the end of the animation. |
protected Mirage |
_image
The image to scale. |
protected float |
_scale
The current amount of scaling to render. |
protected TimeFunction |
_scaleFunc
Computes the image scaling to use at the specified time. |
protected float |
_startScale
The amount to scale the image at the start of the animation. |
| 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 | |
|---|---|
ScaleAnimation(Mirage image,
Point center,
float startScale,
float endScale,
int duration)
Creates a scale animation with the supplied 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. |
Rectangle |
getBounds()
Returns a rectangle containing all the pixels rendered by this media. |
static Rectangle |
getBounds(float scale,
Point center,
Mirage image)
Java wants the first call in a constructor to be super() if it exists at all, so we have to trick it with this function. |
static Point |
getCorner(Point center,
Point size)
Computes the upper left corner where the image should be drawn, given the center and dimensions to which the image should be scaled. |
static Point |
getSize(float scale,
Mirage image)
Computes the width and height to which an image should be scaled. |
void |
paint(Graphics2D gfx)
Called by the appropriate manager to request that the media render itself with the given graphics context. |
void |
tick(long tickStamp)
Called periodically by this media's manager to give it a chance to do its thing. |
| 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, getBounds2D, getPathIterator, getPathIterator, getRenderOrder, init, init, intersects, intersects, invalidate, invalidateAfterChange, naturalCompareTo, queueNotification, removeObserver, renderCompareTo, setRenderOrder, shutdown, toString, toString, viewLocationDidChange |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Mirage _image
protected BufferedImage _bufferedImage
protected Point _center
protected float _startScale
protected float _endScale
protected float _scale
protected TimeFunction _scaleFunc
| Constructor Detail |
|---|
public ScaleAnimation(Mirage image,
Point center,
float startScale,
float endScale,
int duration)
image - The image to paint.center - The screen coordinates of the pixel upon which the image's center should
always be rendered.startScale - The amount to scale the image when it is rendered at time 0.endScale - The amount to scale the image at the final frame of animation.duration - The time in milliseconds the anim takes to complete.| Method Detail |
|---|
public static Rectangle getBounds(float scale,
Point center,
Mirage image)
public Rectangle getBounds()
AbstractMedia
getBounds in interface ShapegetBounds in class AbstractMedia
public static Point getSize(float scale,
Mirage image)
public static Point getCorner(Point center,
Point size)
public void tick(long tickStamp)
AbstractMedia
tick in class AbstractMediatickStamp - 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
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||