Going to look into why when you drag the item, the white loses its transparency. Guessing its to do with drawsprite1
|
|
Very nice, good work on this
Going to look into why when you drag the item, the white loses its transparency. Guessing its to do with drawsprite1

great job bloodisle![]()

It's because drawSprite1 doesn't make white transparent, but drawSprite does. Just use this when you're loading the sprites, before the pixelgrabber.
Code:image = makeColorTransparent(image, new Color(0, 0, 0, 0));Code:public static Image makeColorTransparent (Image im, final Color color) { ImageFilter filter = new RGBImageFilter() { public int markerRGB = color.getRGB() | 0xFF000000; public final int filterRGB(int x, int y, int rgb) { if ( ( rgb | 0xFF000000 ) == markerRGB ) { return 0x00FFFFFF & rgb; } else { return rgb; } } }; ImageProducer ip = new FilteredImageSource(im.getSource(), filter); return Toolkit.getDefaultToolkit().createImage(ip); }

thanks dont think ill use but i might
![]()


Good job lol, don't think i have any use for it though.




Hey blood, How come it wont show up? its like invisible.
This is my constructor
The constructor works everytime i see the item it prints outCode:public Sprite(String customSpriteLocation) { try { Image image = Toolkit.getDefaultToolkit().getImage(""+customSpriteLocation+".png"); System.out.println(customSpriteLocation); 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); } }
./.delta_cache_V2/whip.PNG
Also this is the code in item def
Do you know whats wrong?Code:if(i == 4151)//new rs whip { itemDef.name = "New rs whip"; itemDef.customSpriteLocation = signlink.findcachedir() + "whip.PNG"; }
you dont need to do anything like:
just make sure you do this part of the tutCode:public Sprite(String customSpriteLocation) { try { Image image = Toolkit.getDefaultToolkit().getImage(""+customSpriteLocation+".png"); System.out.println(customSpriteLocation); 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); } }
Code:ItemDef itemDef = ItemDef.forID(j9); if (itemDef.customSpriteLocation != null) { class30_sub2_sub1_sub1_2 = new Sprite(itemDef.customSpriteLocation); }

| « Client theme using Theme.jar | My Completionist Cape Feature Interface! » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |