Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Sprite(String img, int width, int height) {
- try {
- Image image = Toolkit.getDefaultToolkit().createImage(FileOperations.ReadFile(img));
- myWidth = width;
- myHeight = height;
- anInt1444 = myWidth;
- anInt1445 = myHeight;
- anInt1442 = 0;
- anInt1443 = 0;
- myPixels = new int[myWidth * myHeight];
- PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, myWidth, myHeight, myPixels, 0, myWidth);
- pixelgrabber.grabPixels();
- image = null;
- } catch(Exception _ex) {
- System.out.println(_ex);
- }
- if (img.equalsIgnoreCase("tabhover") || img.equalsIgnoreCase("tabclicked")) {
- myWidth = 32;
- myHeight = 37;
- }
- } else if (img.equalsIgnoreCase("frame")) {
- myWidth = 519;
- myHeight = 338;
- }
- for(int i = 4; i <= 8; i++) {
- if (img.equalsIgnoreCase("SPRITE "+i)) {
- myWidth =190;
- myHeight = 224;
- }
- }
- for(int i = 0; i <= 14; i++) {
- if (img.equalsIgnoreCase("icon "+i)) {
- myWidth = 22;
- myHeight = 22;
- }
- }
- }
Add Comment
Please, Sign In to add comment