public class Sprite
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
int |
animationID
The animation number ID
|
java.awt.image.BufferedImage[] |
flippedSprites
Stores the sprites flipped horizontally
|
int |
intervalDelay
The delay between each sprite change
|
int |
numSprites
The number of sprites in an animation
|
boolean |
repetition
Identifies if an animation should be repeated after reaching the final index
|
java.lang.String |
spriteNamePostfix
The sprite filename suffix
|
java.lang.String |
spriteNamePrefix
The sprite filename prefix
|
java.awt.image.BufferedImage[] |
sprites
Stores the sprites
|
int |
startIndex
The starting index of the animation
|
| Constructor and Description |
|---|
Sprite()
The default constructor
|
Sprite(java.lang.String spriteNamePrefix,
java.lang.String spriteNamePostfix,
int numSprites,
int startIndex,
boolean repetition,
int intervalDelay,
int animationID)
The general constructor used to create the sprites
|
public java.lang.String spriteNamePrefix
public java.lang.String spriteNamePostfix
public int numSprites
public int startIndex
public boolean repetition
public int intervalDelay
public int animationID
public java.awt.image.BufferedImage[] sprites
public java.awt.image.BufferedImage[] flippedSprites
public Sprite()
public Sprite(java.lang.String spriteNamePrefix,
java.lang.String spriteNamePostfix,
int numSprites,
int startIndex,
boolean repetition,
int intervalDelay,
int animationID)
spriteNamePrefix - The prefix of the sprite's filespriteNamePostfix - The suffix of the sprite's filenumSprites - The number of sprites in the current animationstartSpriteIndex - The starting index of the animationrepetition - Identifying if the animation is repeated after all sprites have been shownintervalDelay - The delay between the current and next spriteanimationID - The number ID of the sprites