public final class Animations extends Object
Modifier and Type | Method and Description |
---|---|
static MultipleFramesAnimation |
createAnimation(BufferedImage spriteSheet,
int x,
int y,
int width,
int height,
int frames)
Create and return a new multiple frames animation containing all the frame images
from
spriteSheet as specified by the starting location (x, y)
and read horizontally the specified number of frames. |
static SingleFrameAnimation |
createAnimation(File image)
Create and return a new single frame animation from the specified image file.
|
static MultipleFramesAnimation |
createAnimation(File spriteSheet,
int x,
int y,
int width,
int height,
int frames)
Create and return a new multiple frames animation containing all the frame images
from
spriteSheet as specified by the starting location (x, y)
and read horizontally the specified number of frames. |
static MultipleFramesAnimation |
createAnimation(File baseImage,
String suffix,
int frames)
Create and return a new multiple frames animation containing all the frame images
specified from
baseImage . |
static SingleFrameAnimation |
createAnimation(Image image)
Create and return a new single frame animation from the specified image.
|
static SingleFrameAnimation |
createAnimation(InputStream image)
Create and return a new single frame animation from the specified image input stream.
|
static MultipleFramesAnimation |
createAnimation(InputStream spriteSheet,
int x,
int y,
int width,
int height,
int frames)
Create and return a new multiple frames animation containing all the frame images
from
spriteSheet as specified by the starting location (x, y)
and read horizontally the specified number of frames. |
static MultipleFramesAnimation |
createAnimation(List<Image> images)
Create and return a new multiple frames animation containing the specified frame images.
|
static MultipleFramesAnimation |
createAnimation(String baseImage,
String suffix,
int frames)
Create and return a new multiple frames animation containing all the frame images
specified from
baseImage . |
static SingleFrameAnimation |
createAnimation(URL image)
Create and return a new single frame animation from the specified image URL.
|
static MultipleFramesAnimation |
createAnimation(URL spriteSheet,
int x,
int y,
int width,
int height,
int frames)
Create and return a new multiple frames animation containing all the frame images
from
spriteSheet as specified by the starting location (x, y)
and read horizontally the specified number of frames. |
static MultipleFramesAnimation |
createAnimation(URL baseImage,
String suffix,
int frames)
Create and return a new multiple frames animation containing all the frame images
specified from
baseImage . |
static List<Image> |
createFrameList(BufferedImage spriteSheet,
int x,
int y,
int width,
int height,
int frames)
Create and return an unmodifiable list of frame images containing all the frame images
from
spriteSheet as specified by the starting location (x, y)
and read horizontally the specified number of frames. |
static List<Image> |
createFrameList(File spriteSheet,
int x,
int y,
int width,
int height,
int frames)
Create and return an unmodifiable list of frame images containing all the frame images
from
spriteSheet as specified by the starting location (x, y)
and read horizontally the specified number of frames. |
static List<Image> |
createFrameList(File baseImage,
String suffix,
int frames)
Create and return an unmodifiable list of images containing all the frame images
specified from
baseImage . |
static List<Image> |
createFrameList(InputStream spriteSheet,
int x,
int y,
int width,
int height,
int frames)
Create and return an unmodifiable list of frame images containing all the frame images
from
spriteSheet as specified by the starting location (x, y)
and read horizontally the specified number of frames. |
static List<Image> |
createFrameList(String baseImage,
String suffix,
int frames)
Create and return an unmodifiable list of images containing all the frame images
specified from
baseImage . |
static List<Image> |
createFrameList(URL spriteSheet,
int x,
int y,
int width,
int height,
int frames)
Create and return an unmodifiable list of frame images containing all the frame images
from
spriteSheet as specified by the starting location (x, y)
and read horizontally the specified number of frames. |
static List<Image> |
createFrameList(URL baseImage,
String suffix,
int frames)
Create and return an unmodifiable list of images containing all the frame images
specified from
baseImage . |
static LoopedFramesAnimation |
createLoopedAnimation(BufferedImage spriteSheet,
int x,
int y,
int width,
int height,
int frames)
Create and return a new looped frames animation containing all the frame images
from
spriteSheet as specified by the starting location (x, y)
and read horizontally the specified number of frames. |
static LoopedFramesAnimation |
createLoopedAnimation(File spriteSheet,
int x,
int y,
int width,
int height,
int frames)
Create and return a new looped frames animation containing all the frame images
from
spriteSheet as specified by the starting location (x, y)
and read horizontally the specified number of frames. |
static LoopedFramesAnimation |
createLoopedAnimation(File baseImage,
String suffix,
int frames)
Create and return a new looped frames animation containing all the frame images
specified from
baseImage . |
static LoopedFramesAnimation |
createLoopedAnimation(InputStream spriteSheet,
int x,
int y,
int width,
int height,
int frames)
Create and return a new looped frames animation containing all the frame images
from
spriteSheet as specified by the starting location (x, y)
and read horizontally the specified number of frames. |
static LoopedFramesAnimation |
createLoopedAnimation(List<Image> images)
Create and return a new looped frames animation containing the specified frame images.
|
static LoopedFramesAnimation |
createLoopedAnimation(String baseImage,
String suffix,
int frames)
Create and return a new looped frames animation containing all the frame images
specified from
baseImage . |
static LoopedFramesAnimation |
createLoopedAnimation(URL spriteSheet,
int x,
int y,
int width,
int height,
int frames)
Create and return a new looped frames animation containing all the frame images
from
spriteSheet as specified by the starting location (x, y)
and read horizontally the specified number of frames. |
static LoopedFramesAnimation |
createLoopedAnimation(URL baseImage,
String suffix,
int frames)
Create and return a new looped frames animation containing all the frame images
specified from
baseImage . |
static BufferedImage |
createSpriteSheet(File baseImage,
String suffix,
int frames)
Create and return a new sprite sheet image containing all of the specified frame images
specified from
baseImage assembled horizontally. |
static BufferedImage |
createSpriteSheet(List<Image> frameImages)
Create and return a new sprite sheet image containing all of the specified frame images
assembled horizontally.
|
static BufferedImage |
createSpriteSheet(String baseImage,
String suffix,
int frames)
Create and return a new sprite sheet image containing all of the specified frame images
specified from
baseImage assembled horizontally. |
static BufferedImage |
createSpriteSheet(URL baseImage,
String suffix,
int frames)
Create and return a new sprite sheet image containing all of the specified frame images
specified from
baseImage assembled horizontally. |
static List<Image> |
flipHorizontally(List<Image> frameImages)
Create and return an unmodifiable list of frame images containing all the frame images
from
frameImages in the same order flipped horizontally. |
static List<Image> |
flipVertically(List<Image> frameImages)
Create and return an unmodifiable list of frame images containing all the frame images
from
frameImages in the same order flipped vertically. |
static List<Image> |
rotate(BufferedImage image,
int steps)
Create and return an unmodifiable list of frame images created by
rotating around the center of specified image 2π/steps times.
|
public static SingleFrameAnimation createAnimation(InputStream image) throws IOException
image
- image input streamIOException
- if an IO error occurspublic static SingleFrameAnimation createAnimation(File image) throws IOException
image
- image fileIOException
- if an IO error occurspublic static SingleFrameAnimation createAnimation(URL image) throws IOException
image
- image URLIOException
- if an IO error occurspublic static SingleFrameAnimation createAnimation(Image image)
image
- imagepublic static MultipleFramesAnimation createAnimation(String baseImage, String suffix, int frames) throws IOException
baseImage
.baseImage
- base image file or URL namesuffix
- image suffixframes
- number of framesbaseImage
IOException
- if an IO error occurspublic static MultipleFramesAnimation createAnimation(File baseImage, String suffix, int frames) throws IOException
baseImage
.baseImage
- base image filesuffix
- image suffixframes
- number of framesbaseImage
IOException
- if an IO error occurspublic static MultipleFramesAnimation createAnimation(URL baseImage, String suffix, int frames) throws IOException
baseImage
.baseImage
- base image URLsuffix
- image suffixframes
- number of framesbaseImage
IOException
- if an IO error occurspublic static LoopedFramesAnimation createLoopedAnimation(String baseImage, String suffix, int frames) throws IOException
baseImage
.baseImage
- base image file or URL namesuffix
- image suffixframes
- number of framesbaseImage
IOException
- if an IO error occurspublic static LoopedFramesAnimation createLoopedAnimation(File baseImage, String suffix, int frames) throws IOException
baseImage
.baseImage
- base image filesuffix
- image suffixframes
- number of framesbaseImage
IOException
- if an IO error occurspublic static LoopedFramesAnimation createLoopedAnimation(URL baseImage, String suffix, int frames) throws IOException
baseImage
.baseImage
- base image URLsuffix
- image suffixframes
- number of framesbaseImage
IOException
- if an IO error occurspublic static MultipleFramesAnimation createAnimation(InputStream spriteSheet, int x, int y, int width, int height, int frames) throws IOException
spriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of frames.spriteSheet
- sprite sheet input streamx
- starting location xy
- starting location ywidth
- frame widthheight
- frame heightframes
- number of framesspriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of framesIOException
- if an IO error occurspublic static MultipleFramesAnimation createAnimation(File spriteSheet, int x, int y, int width, int height, int frames) throws IOException
spriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of frames.spriteSheet
- sprite sheet filex
- starting location xy
- starting location ywidth
- frame widthheight
- frame heightframes
- number of framesspriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of framesIOException
- if an IO error occurspublic static MultipleFramesAnimation createAnimation(URL spriteSheet, int x, int y, int width, int height, int frames) throws IOException
spriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of frames.spriteSheet
- sprite sheet URLx
- starting location xy
- starting location ywidth
- frame widthheight
- frame heightframes
- number of framesspriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of framesIOException
- if an IO error occurspublic static MultipleFramesAnimation createAnimation(BufferedImage spriteSheet, int x, int y, int width, int height, int frames)
spriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of frames.spriteSheet
- sprite sheet imagex
- starting location xy
- starting location ywidth
- frame widthheight
- frame heightframes
- number of framesspriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of framespublic static LoopedFramesAnimation createLoopedAnimation(InputStream spriteSheet, int x, int y, int width, int height, int frames) throws IOException
spriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of frames.spriteSheet
- sprite sheet input streamx
- starting location xy
- starting location ywidth
- frame widthheight
- frame heightframes
- number of framesspriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of framesIOException
- if an IO error occurspublic static LoopedFramesAnimation createLoopedAnimation(File spriteSheet, int x, int y, int width, int height, int frames) throws IOException
spriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of frames.spriteSheet
- sprite sheet filex
- starting location xy
- starting location ywidth
- frame widthheight
- frame heightframes
- number of framesspriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of framesIOException
- if an IO error occurspublic static LoopedFramesAnimation createLoopedAnimation(URL spriteSheet, int x, int y, int width, int height, int frames) throws IOException
spriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of frames.spriteSheet
- sprite sheet URLx
- starting location xy
- starting location ywidth
- frame widthheight
- frame heightframes
- number of framesspriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of framesIOException
- if an IO error occurspublic static LoopedFramesAnimation createLoopedAnimation(BufferedImage spriteSheet, int x, int y, int width, int height, int frames)
spriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of frames.spriteSheet
- sprite sheet imagex
- starting location xy
- starting location ywidth
- frame widthheight
- frame heightframes
- number of framesspriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of framespublic static MultipleFramesAnimation createAnimation(List<Image> images)
images
- list of frame images, must not be nullpublic static LoopedFramesAnimation createLoopedAnimation(List<Image> images)
images
- list of frame images, must not be nullpublic static List<Image> createFrameList(String baseImage, String suffix, int frames) throws IOException
baseImage
.baseImage
- base image file or URL namesuffix
- image suffixframes
- number of framesbaseImage
IOException
- if an IO error occurspublic static List<Image> createFrameList(File baseImage, String suffix, int frames) throws IOException
baseImage
.baseImage
- base image filesuffix
- image suffixframes
- number of framesbaseImage
IOException
- if an IO error occurspublic static List<Image> createFrameList(URL baseImage, String suffix, int frames) throws IOException
baseImage
.baseImage
- base image URLsuffix
- image suffixframes
- number of framesbaseImage
IOException
- if an IO error occurspublic static List<Image> createFrameList(InputStream spriteSheet, int x, int y, int width, int height, int frames) throws IOException
spriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of frames.spriteSheet
- sprite sheet input streamx
- starting location xy
- starting location ywidth
- frame widthheight
- frame heightframes
- number of framesspriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of framesIOException
- if an IO error occurspublic static List<Image> createFrameList(File spriteSheet, int x, int y, int width, int height, int frames) throws IOException
spriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of frames.spriteSheet
- sprite sheet filex
- starting location xy
- starting location ywidth
- frame widthheight
- frame heightframes
- number of framesspriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of framesIOException
- if an IO error occurspublic static List<Image> createFrameList(URL spriteSheet, int x, int y, int width, int height, int frames) throws IOException
spriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of frames.spriteSheet
- sprite sheet filex
- starting location xy
- starting location ywidth
- frame widthheight
- frame heightframes
- number of framesspriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of framesIOException
- if an IO error occurspublic static List<Image> createFrameList(BufferedImage spriteSheet, int x, int y, int width, int height, int frames)
spriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of frames.spriteSheet
- sprite sheet imagex
- starting location xy
- starting location ywidth
- frame widthheight
- frame heightframes
- number of framesspriteSheet
as specified by the starting location (x, y)
and read horizontally the specified number of framespublic static BufferedImage createSpriteSheet(List<Image> frameImages)
frameImages
- frame images, must not be nullpublic static BufferedImage createSpriteSheet(String baseImage, String suffix, int frames) throws IOException
baseImage
assembled horizontally.baseImage
- base image file or URL namesuffix
- image suffixframes
- number of framesbaseImage
assembled horizontallyIOException
- if an IO error occurspublic static BufferedImage createSpriteSheet(File baseImage, String suffix, int frames) throws IOException
baseImage
assembled horizontally.baseImage
- base image filesuffix
- image suffixframes
- number of framesbaseImage
assembled horizontallyIOException
- if an IO error occurspublic static BufferedImage createSpriteSheet(URL baseImage, String suffix, int frames) throws IOException
baseImage
assembled horizontally.baseImage
- base image URLsuffix
- image suffixframes
- number of framesbaseImage
assembled horizontallyIOException
- if an IO error occurspublic static List<Image> flipHorizontally(List<Image> frameImages)
frameImages
in the same order flipped horizontally.frameImages
- list of frame images, must not be nullframeImages
in the same order flipped horizontallypublic static List<Image> flipVertically(List<Image> frameImages)
frameImages
in the same order flipped vertically.frameImages
- list of frame images, must not be nullframeImages
in the same order flipped verticallypublic static List<Image> rotate(BufferedImage image, int steps)
image
- image to rotate, must not be nullsteps
- number of stepsCopyright (c) 2006-2013 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).