OK, most people have this, but if you are using a 317 deob like me, you don't have it. So I am going to tell you and teach you how its done.
The 317 Deob by default uses the Background class to load its Side Icons, and to position them.
The positioning is done by using the method 361 in the Background class.
The loading of the Side Icons is done by using the following line:
Code:
sideIcons[j3] = new Background(streamLoader_2, "sideicons", j3);
j3 is a variable declared in a for loop.
Code:
for(int j3 = 0; j3 < 13; j3++)
sideIcons[j3] = new Background(streamLoader_2, "sideicons", j3);
As you can see, j3 can only go from 0 to 12. Meaning that there are 12 Side Icon sprites.
The Side Icons are added when the following is called:
Code:
sideIcons[0].method361(29, 13);
This is when the icon is placed on the game interface. 29 being the X, 13 being the Y.
Now, to make the custom icons load, you need to load them from the Sprite class, which can be done by changing the following:
Code:
private Background[] sideIcons;
sideIcons = new Background[13];
sideIcons[j3] = new Background(streamLoader_2, "sideicons", j3);
to
Code:
private Sprite[] sideIcons;
sideIcons = new Sprite[13];
sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
But this is not all that must be done, if you do this you will get an error because method361 does not exist in the Sprite class. So you need to have a substitute for that method(this method positions the sprites).
If you change method361 to method346, you will have it all fixed and loading correctly.
Make sense? Good.
Now to load the sprite from this, you need to add the following into the Sprite constructor.
Code:
if (s.contains("sideicons"))
{
try
{
Image img = Toolkit.getDefaultToolkit().getImage("./Sprites" + s + ".png");
myPixels = new int[myWidth * myHeight];
PixelGrabber pixelgrabber = new PixelGrabber(img, 0, 0, myWidth, myHeight, myPixels,
0, myWidth);
pixelgrabber.grabPixels();
} catch(Exception e)
{
}
}
This code will load the sideicons 0, sideicons 1, sideicons 2, ext ext from the Sprites folder.
Does it all make sense now? If not, ask a question...
Notes:
If method346 doesn't work, try drawSprite or drawSprite1
P.S, I haven't fully tested, because I don't have any side icons to change yet, but this should work.