public interface AnimatedSprite extends Sprite
Modifier and Type | Method and Description |
---|---|
AnimatedSprite |
clone()
Get cloned version of current animatedsprite.
|
int |
getFrame()
Get the current playing frame number.
|
java.awt.image.BufferedImage |
getFrame(int frame)
Get the representative surface of a frame (first frame is 1).
|
int |
getFrameHeight()
Get current frame height.
|
int |
getFrameOriginalHeight()
Get original frame height.
|
int |
getFrameOriginalWidth()
Get original frame width.
|
int |
getFramesNumber()
Get the number of frames.
|
int |
getFrameWidth()
Get current frame width.
|
int |
getHorizontalFrames()
Get the number of horizontal frames.
|
int |
getState()
Get the current animation state.
|
int |
getVerticalFrames()
Get the number of vertical frames.
|
void |
play(Animation animation)
Play the animated sprite with a specific animation, previously created.
|
void |
play(Animation animation,
float speed)
Play the animated sprite with a specific animation, previously created.
|
void |
play(int start,
int end,
float speed,
boolean reverse,
boolean repeat)
Play the animated sprite with a specific animation, previously created.
|
void |
render(java.awt.Graphics2D g,
int x,
int y)
Render current frame on graphic output at specified coordinates.
|
void |
render(java.awt.Graphics2D g,
int x,
int y,
boolean mirror)
Render a frame on graphic output at specified coordinates.
|
void |
render(java.awt.Graphics2D g,
int frame,
int x,
int y)
Render a specified frame on graphic output at specified coordinates.
|
void |
render(java.awt.Graphics2D g,
int frame,
int x,
int y,
boolean mirror)
Render a specified frame on graphic output at specified coordinates.
|
void |
setFrame(int frame)
Set a fixed frame.
|
void |
stop()
Stop the current animation.
|
void |
update(float extrp)
Set the current extrapolation value (in main loop).
|
filter, flipHorizontal, flipVertical, getHeightOriginal, getSurface, getWidthOriginal, rotate, scale, stretch
getHeight, getWidth
void play(Animation animation)
animation
- animation reference.void play(Animation animation, float speed)
animation
- animation reference.speed
- specified speed.void play(int start, int end, float speed, boolean reverse, boolean repeat)
start
- first frame to play.end
- last frame to reach.speed
- specified speed.reverse
- reverse play when end is reach.repeat
- play in loop.void stop()
void update(float extrp)
extrp
- extrapolation value.void render(java.awt.Graphics2D g, int x, int y)
render
in interface Renderable
g
- graphic output.x
- abscissa.y
- ordinate.void render(java.awt.Graphics2D g, int frame, int x, int y)
g
- graphic output.frame
- frame to render.x
- abscissa.y
- ordinate.void render(java.awt.Graphics2D g, int x, int y, boolean mirror)
g
- graphic output.x
- abscissa.y
- ordinate.mirror
- true if it is a mirror rendering.void render(java.awt.Graphics2D g, int frame, int x, int y, boolean mirror)
g
- graphic output.frame
- frame to render.x
- abscissa.y
- ordinate.mirror
- true if it is a mirror rendering.void setFrame(int frame)
frame
- frame to set.int getFrame()
int getState()
int getHorizontalFrames()
int getVerticalFrames()
int getFramesNumber()
int getFrameWidth()
int getFrameHeight()
int getFrameOriginalWidth()
int getFrameOriginalHeight()
java.awt.image.BufferedImage getFrame(int frame)
frame
- frame to get.AnimatedSprite clone()