Guest User

Untitled

a guest
Jan 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.21 KB | None | 0 0
  1. public Sprite(String img, int width, int height) {
  2.         try {
  3.             Image image = Toolkit.getDefaultToolkit().createImage(FileOperations.ReadFile(img));
  4.             myWidth = width;
  5.             myHeight = height;
  6.             anInt1444 = myWidth;
  7.             anInt1445 = myHeight;
  8.             anInt1442 = 0;
  9.             anInt1443 = 0;
  10.             myPixels = new int[myWidth * myHeight];
  11.             PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, myWidth, myHeight, myPixels, 0, myWidth);
  12.             pixelgrabber.grabPixels();
  13.             image = null;
  14.         } catch(Exception _ex) {
  15.             System.out.println(_ex);
  16.         }
  17.         if (img.equalsIgnoreCase("tabhover") || img.equalsIgnoreCase("tabclicked")) {
  18.                 myWidth = 32;
  19.                 myHeight = 37;
  20.             }
  21.          } else if (img.equalsIgnoreCase("frame")) {
  22.                 myWidth = 519;
  23.                 myHeight = 338;
  24.             }
  25.             for(int i = 4; i <= 8; i++) {
  26.                 if (img.equalsIgnoreCase("SPRITE "+i)) {
  27.                     myWidth =190;
  28.                     myHeight = 224;
  29.                 }
  30.             }
  31.             for(int i = 0; i <= 14; i++) {
  32.                 if (img.equalsIgnoreCase("icon "+i)) {
  33.                     myWidth = 22;
  34.                     myHeight = 22;
  35.                 }
  36.             }
  37.     }
Add Comment
Please, Sign In to add comment