|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.b3dgs.lionengine.drawable.impl.DrawableFactory
public final class DrawableFactory
Field Summary |
---|
Fields inherited from interface com.b3dgs.lionengine.Drawable |
---|
DRAWABLE |
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 filename,
int size,
int style)
Create a font, which supports screen output text. |
static Drawable |
getInstance()
|
AnimatedSprite |
loadAnimatedSprite(java.awt.image.BufferedImage surface,
int numberOfHorizontalFrames,
int numberOfVerticalFrames)
Create an animated sprite, giving horizontal and vertical frames (sharing the same surface). |
AnimatedSprite |
loadAnimatedSprite(java.lang.String filename,
int numberOfHorizontalFrames,
int numberOfVerticalFrames)
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Drawable getInstance()
public Image loadImage(java.lang.String filename)
Drawable
loadImage
in interface Drawable
filename
- file name.
public Image loadImage(java.awt.image.BufferedImage surface)
Drawable
loadImage
in interface Drawable
surface
- file name.
public Sprite loadSprite(java.lang.String filename)
Drawable
loadSprite
in interface Drawable
filename
- file name.
public Sprite loadSprite(java.awt.image.BufferedImage surface)
Drawable
loadSprite
in interface Drawable
surface
- image reference.
public AnimatedSprite loadAnimatedSprite(java.lang.String filename, int numberOfHorizontalFrames, int numberOfVerticalFrames)
Drawable
loadAnimatedSprite
in interface Drawable
filename
- file name.numberOfHorizontalFrames
- number of horizontal frames.numberOfVerticalFrames
- number of vertical frames.
public AnimatedSprite loadAnimatedSprite(java.awt.image.BufferedImage surface, int numberOfHorizontalFrames, int numberOfVerticalFrames)
Drawable
loadAnimatedSprite
in interface Drawable
surface
- image reference.numberOfHorizontalFrames
- number of horizontal frames.numberOfVerticalFrames
- number of vertical frames.
public TiledSprite loadTiledSprite(java.lang.String filename, int tileWidth, int tileHeight)
Drawable
loadTiledSprite
in interface Drawable
filename
- file name.tileWidth
- tile width.tileHeight
- tile height.
public TiledSprite loadTiledSprite(java.awt.image.BufferedImage surface, int tileWidth, int tileHeight)
Drawable
loadTiledSprite
in interface Drawable
surface
- image reference.tileWidth
- tile width.tileHeight
- tile height.
public ParallaxedSprite loadParallaxedSprite(java.lang.String filename, int numberOfLines, int sx, int sy)
Drawable
loadParallaxedSprite
in interface Drawable
filename
- file name.numberOfLines
- number of parallax lines.sx
- starting width.sy
- starting height.
public Animation createAnimation(int firstFrame, int lastFrame, int step, float speed, boolean reverse, boolean repeat)
Drawable
step
:
Mainly used for strategy games, where the entry has different orientations.
The step represents the number of frames per orientation for this animation.
createAnimation
in interface Drawable
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).
public Animator createAnimator()
Drawable
createAnimator
in interface Drawable
public Text createText(java.lang.String filename, int size, int style)
Drawable
createText
in interface Drawable
filename
- 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
public FontSprite createFontSprite(java.lang.String filename, java.lang.String data, int lw, int lh)
Drawable
createFontSprite
in interface Drawable
filename
- font surface filename.data
- font data filename.lw
- font image letter width.lh
- font image letter height.
public Cursor createCursor(Screen screen, java.lang.String cursor)
Drawable
createCursor
in interface Drawable
screen
- screen reference.cursor
- cursor image name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |