Purpose: To create your own interfaces.
Difficulty: 3/10, if you have common sense and basic client/Java knowledge its easier.
Assumed Knowledge: Basic client knowledge, basic Java knowledge.
Classes Modified: RSInterface.java and Sprite.java
Client Base: My renamed/refactored client base.
I'm going to teach you guys how to make a basic interface using my client base and the methods in it. I have already added every basic method you will be needing. This tutorial will just teach you how to use them.
_____________________
Step 1: Learning the usage of each method.
Here, I will teach you how to use each method in the interface class. First, you are going to want to make your interface load, so you declare your interface.
Above "public static void addText", add your interface method:
Code:
public static void interfaceExample() {
}
Now obviously that won't do much, you need to assign the interface ID, and give it features! Well, addTabInterface is the method used for this! So, now you would have a method looking like this:
Code:
public static void interfaceExample() {
RSInterface tab = addTabInterface(17000);
}
RSInterface tab is what is used to call the static voids declared. For example, tab.booleanExample = true;. That boolean is being referenced as a static boolean, which is the "tab." part. You can chance the 17000 to any ID you want, but that is the main interface ID. Now lets say you want to add some text onto your interface. Here is what you would use:
Code:
public static void interfaceExample(TextDrawingArea[] tda) {
RSInterface tab = addTabInterface(17000);
addText(17001, "Text displayer", tda, 1, 0xffffff, true, true);
}
That uses the addText method to display: addText(childID, "Text", tda, font size, color, center text, text shadow);. Also, you have to add TextDrawingArea[] tda in the method so the method can then draw text.
Now you need the text to actually become a child interface. So the method would look like this:
Code:
public static void interfaceExample(TextDrawingArea[] tda) {
RSInterface tab = addTabInterface(17000);
addText(17001, "Text displayed", tda, 1, 0xffffff, true, true);
tab.totalChildren(1);
tab.child(0, 17001, 92, 15);
}
totalChildren(amount); is used to declare the total amount of child interfaces used in the interface. In this case, it is 1. The line below that is used to give the first child interface data, used as child(id, childID, xPosition, yPosition);. The first child interface is always 0, not 1.
Now to make the interface load with all the others, find "aClass44 = streamLoader;", and below it add:
Code:
interfaceExample(textDrawingAreas);
I will be going more in depth and releasing more interfaces in time, but for now, play with this and learn more and more .