I need to be able to take certain images from one big image on a grid. Sort of like how in the game minecraft, there are texture packs that retexture the way the game looks. In order to keep file size down, it is not all that many actual pictures. It is a grid of all the different block texture all on one picture.
I need to do something similar to this, but using this picture: http://f.cl.ly/items/122C0G3R3P422R2I452o/fontes_blanches_alpha.png
Specifically, i want to be able to call each character from this picture from an ArrayList sort of like:
(Pseudo code)
ArrayList<Pictures> chars = new ArrayList<Pictures>();
JFrame.add(chars.get(x));
So, how would i separate the pictures to display only part of it?
You could try loading the font image into a
BufferedImageobject. Then you can saybufferedImage.getSubimage(x,y,w,h)to get a subImage of typeBufferedImage. When you have a subImage, you can add it to your “chars” ArrayList.