Class SpriteSheet
- java.lang.Object
-
- net.egartley.beyondorigins.core.graphics.SpriteSheet
-
public class SpriteSheet extends java.lang.Object
An image that contains multiple sprites, each represented by a row, or "strip" that is specified in the constructor- See Also:
Sprite
-
-
Field Summary
Fields Modifier and Type Field Description private int
frames
private org.newdawn.slick.Image
sheet
private int
spriteHeight
java.util.ArrayList<Sprite>
sprites
private int
spriteWidth
private int
strips
private int
stripWidth
-
Constructor Summary
Constructors Constructor Description SpriteSheet(org.newdawn.slick.Image sheet, int width)
SpriteSheet(org.newdawn.slick.Image sheet, int rows, int frames)
SpriteSheet(org.newdawn.slick.Image image, int width, int height, int rows, int frames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private org.newdawn.slick.Image
getRow(int index)
Returns the "strip" at the given indexSprite
getSprite(int index)
private void
load()
Builds the sprite collection from the sheet image (should have already been set)
-
-
-
Field Detail
-
spriteWidth
private final int spriteWidth
-
spriteHeight
private final int spriteHeight
-
strips
private final int strips
-
stripWidth
private final int stripWidth
-
frames
private final int frames
-
sheet
private final org.newdawn.slick.Image sheet
-
sprites
public java.util.ArrayList<Sprite> sprites
-
-
Method Detail
-
load
private void load()
Builds the sprite collection from the sheet image (should have already been set)
-
getRow
private org.newdawn.slick.Image getRow(int index)
Returns the "strip" at the given index- Parameters:
index
- The row number, or index, of the "strip" to return in the strip
-
getSprite
public Sprite getSprite(int index)
-
-