|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Drawable
Handle gfx ressources, such as images, sprites, tiles, animations... Fastest way to call drawable factory:
import static com.b3dgs.lionengine.Drawable.DRAWABLE; //... DRAWABLE.xxx
Field Summary | |
---|---|
static Drawable |
DRAWABLE
Drawable factory. |
Method Summary | |
---|---|
Animation |
createAnimation(int firstFrame,
int lastFrame,
int step,
float speed,
boolean reverse,
boolean repeat)
Create an animation, which can be read by an animated sprite. |
Animator |
createAnimator()
Create an animation player, which we will be able to play an animation data container. |
Cursor |
createCursor(Screen screen,
java.lang.String cursor)
Create a cursor, which is automatically handled by the mouse. |
FontSprite |
createFontSprite(java.lang.String filename,
java.lang.String data,
int lw,
int lh)
Create a font based on an image. |
Text |
createText(java.lang.String fontname,
int size,
int style)
Create a font, which supports screen output text. |
AnimatedSprite |
loadAnimatedSprite(java.awt.image.BufferedImage surface,
int horizontalFrames,
int verticalFrames)
Create an animated sprite, giving horizontal and vertical frames (sharing the same surface). |
AnimatedSprite |
loadAnimatedSprite(java.lang.String filename,
int horizontalFrames,
int verticalFrames)
Load an animated sprite from a file, giving horizontal and vertical frames. |
Image |
loadImage(java.awt.image.BufferedImage surface)
Create an image from a buffered image (sharing the same surface). |
Image |
loadImage(java.lang.String filename)
Load an image from a file. |
ParallaxedSprite |
loadParallaxedSprite(java.lang.String filename,
int numberOfLines,
int sx,
int sy)
Load a parallaxed sprite, for parallax effect. |
Sprite |
loadSprite(java.awt.image.BufferedImage surface)
Create a sprite from a buffered image (sharing the same surface). |
Sprite |
loadSprite(java.lang.String filename)
Load a sprite from a file. |
TiledSprite |
loadTiledSprite(java.awt.image.BufferedImage surface,
int tileWidth,
int tileHeight)
Create a tiled sprite using an image reference, giving tile dimension (sharing the same surface). |
TiledSprite |
loadTiledSprite(java.lang.String filename,
int tileWidth,
int tileHeight)
Load a tiled sprite from a file, giving tile dimension. |
Field Detail |
---|
static final Drawable DRAWABLE
Method Detail |
---|
Image loadImage(java.lang.String filename)
filename
- file name.
Image loadImage(java.awt.image.BufferedImage surface)
surface
- file name.
Sprite loadSprite(java.lang.String filename)
filename
- file name.
Sprite loadSprite(java.awt.image.BufferedImage surface)
surface
- image reference.
AnimatedSprite loadAnimatedSprite(java.lang.String filename, int horizontalFrames, int verticalFrames)
filename
- file name.horizontalFrames
- number of horizontal frames.verticalFrames
- number of vertical frames.
AnimatedSprite loadAnimatedSprite(java.awt.image.BufferedImage surface, int horizontalFrames, int verticalFrames)
surface
- image reference.horizontalFrames
- number of horizontal frames.verticalFrames
- number of vertical frames.
TiledSprite loadTiledSprite(java.lang.String filename, int tileWidth, int tileHeight)
filename
- file name.tileWidth
- tile width.tileHeight
- tile height.
TiledSprite loadTiledSprite(java.awt.image.BufferedImage surface, int tileWidth, int tileHeight)
surface
- image reference.tileWidth
- tile width.tileHeight
- tile height.
ParallaxedSprite loadParallaxedSprite(java.lang.String filename, int numberOfLines, int sx, int sy)
filename
- file name.numberOfLines
- number of parallax lines.sx
- starting width.sy
- starting height.
Animation createAnimation(int firstFrame, int lastFrame, int step, float speed, boolean reverse, boolean repeat)
step
:
Mainly used for strategy games, where the entry has different orientations.
The step represents the number of frames per orientation for this animation.
firstFrame
- first frame index to play.lastFrame
- last frame index to play.step
- animation step number.speed
- animation playing speed.reverse
- true to reverse play (play from first to last, and last to first).repeat
- repeat state (loop play).
Animator createAnimator()
Text createText(java.lang.String fontname, int size, int style)
fontname
- font name.size
- font size (in px).style
- font style (NORMAL, BOLD, ITALIC).
Font.DIALOG
,
Font.MONOSPACED
,
Font.SANS_SERIF
,
Font.SERIF
,
Text.NORMAL
,
Text.BOLD
,
Text.ITALIC
FontSprite createFontSprite(java.lang.String filename, java.lang.String data, int lw, int lh)
filename
- font surface filename.data
- font data filename.lw
- font image letter width.lh
- font image letter height.
Cursor createCursor(Screen screen, java.lang.String cursor)
screen
- screen reference.cursor
- cursor image name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |