1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| static public Image[] splitAnim(Image comboImage, int startX, int startY, int width, int height, int frameCount, GraphicsConfiguration gc) { Color c = new Color(0,0,0,0); Image[] frames = new Image[frameCount]; for(int frame = 0; frame<frameCount; frame++) { BufferedImage bi = gc.createCompatibleImage(width,height,Transparency.TRANSLUCENT); Graphics g = bi.getGraphics(); g.drawImage(comboImage, 0,0,width,height, startX+(width*frame),startY,startX+(width*(frame+1)),startY+(height), null,null); frames[frame] = bi; } return frames; } |