HUD_LAYER| Constructor and Description |
|---|
ScaleAnimation(Mirage image,
Point center,
float startScale,
float endScale,
int duration)
Creates a scale animation with the supplied image.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
addAnimationObserver, isFinished, removeAnimationObserver, reset, setLocationcontains, contains, contains, contains, getBounds2D, getPathIterator, getPathIterator, getRenderOrder, init, intersects, intersects, invalidate, queueNotification, renderCompareTo, setRenderOrder, toString, viewLocationDidChangepublic 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.public static Rectangle getBounds(float scale, Point center, Mirage image)
public Rectangle getBounds()
AbstractMediagetBounds in interface ShapegetBounds in class AbstractMediapublic static Point getSize(float scale, Mirage image)
public static Point getCorner(Point center, Point size)
public void tick(long tickStamp)
AbstractMediatick 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)
AbstractMediafastForward in class AbstractMediapublic void paint(Graphics2D gfx)
AbstractMediapaint in class AbstractMediaCopyright © 2015. All rights reserved.