|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AnimatedSprite
AnimatedSprite is an extended sprite, as it is now able to play it, using animations data. It works like a sprite expected it renders only a part of it (animation job). Animation data contains the first/last frame and the animation speed. Considering the main first frame is on the top-left sprite surface, and the last frame is on the down-right sprite surface, reading it from left to right. The first frame number is 1.
Animation
,
AnimState
Method Summary | |
---|---|
java.awt.image.BufferedImage |
getFrame(int frame)
Get the representative surface of a frame. |
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 |
getVerticalFrames()
Get the number of vertical frames. |
AnimatedSprite |
instanciate()
Get instancied version of current animated sprite (shares the same surface). |
void |
render(java.awt.Graphics2D g,
int x,
int y)
Render active frame on graphic output at specified coordinates. |
void |
render(java.awt.Graphics2D g,
int x,
int y,
boolean mirror)
Render active frame on graphic output at specified coordinates. |
void |
render(java.awt.Graphics2D g,
int frame,
int x,
int y)
Render a specific frame on graphic output at specified coordinates. |
void |
render(java.awt.Graphics2D g,
int frame,
int x,
int y,
boolean mirror)
Render a specific frame on graphic output at specified coordinates. |
Methods inherited from interface com.b3dgs.lionengine.drawable.Sprite |
---|
filter, flipHorizontal, flipVertical, getHeightOriginal, getSurface, getWidthOriginal, load, rotate, scale, setAlpha, setTransparency, stretch |
Methods inherited from interface com.b3dgs.lionengine.drawable.Renderable |
---|
getHeight, getWidth |
Methods inherited from interface com.b3dgs.lionengine.drawable.Animator |
---|
getAnimState, getFrame, getRealFrame, play, play, play, setFrame, setSkipLastFrameOnReverse, stopAnimation, updateAnimation |
Method Detail |
---|
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 (rendering is flipped).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 (rendering is flipped).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 instanciate()
instanciate
in interface Image
instanciate
in interface Sprite
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |