I use a sprite sheet and set it up to get the int [] pixel of each sprite, I'm just not sure how to use this int [] pixel to create a separate image.
my code is:
i=0;
BufferedImage[] bi = new BufferedImage[];
for(y) {
for (x) {
int[] pixels = null;
Vars.TILE_SHEET_BI().getRaster().getPixels(x, y, 16, 16, pixels);
bi[i] = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
bi[i].getRaster().setPixels(0, 0, 16, 16, pixels);
i++;
}
}
source
share