|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Sprite
Sprites works like images, but it supports modifications, such as scaling and filtering. Sprites are recommended for dynamic uses, such as menus or backgrounds elements (which are not statics).
Method Summary | |
---|---|
void |
filter(Filter filter)
Apply a filter to the sprite. |
void |
flipHorizontal()
Flip the sprite horizontaly. |
void |
flipVertical()
Flip the sprite verticaly. |
int |
getHeightOriginal()
Get the current sprite height (its current size, after scaling operation). |
java.awt.image.BufferedImage |
getSurface()
Get the sprite surface, represented by a BufferedImage. |
int |
getWidthOriginal()
Get the current sprite width (its current size, after scaling operation). |
Sprite |
instanciate()
Get instancied version of current sprite (shares the same surface). |
void |
load(boolean alpha)
Load surface and prepare it to be displayed. |
void |
rotate(int angle)
Rotate the sprite with the specified angle. |
void |
scale(int percent)
Method used for sprite scaling, in order to modify its size. |
void |
setAlpha(int alpha)
Set alpha value [0-255]. |
void |
setTransparency(java.awt.Color mask)
Set transparency color. |
void |
stretch(int percentWidth,
int percentHeight)
Works as scale, but using differents width and height factor. |
Methods inherited from interface com.b3dgs.lionengine.drawable.Renderable |
---|
getHeight, getWidth, render |
Method Detail |
---|
void load(boolean alpha)
alpha
- true to enable alpha.void scale(int percent)
percent
- value for scaling.void stretch(int percentWidth, int percentHeight)
percentWidth
- percent value for scaling width.percentHeight
- percent value for scaling height.void rotate(int angle)
angle
- rotation angle.void flipHorizontal()
void flipVertical()
void filter(Filter filter)
filter
- filter to use.void setTransparency(java.awt.Color mask)
mask
- color mask.void setAlpha(int alpha)
alpha
- alpha value.int getWidthOriginal()
int getHeightOriginal()
java.awt.image.BufferedImage getSurface()
getSurface
in interface Image
Sprite instanciate()
instanciate
in interface Image
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |