Thread: Make an interface moving

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1 Make an interface moving 
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Hello Rune-Server,
    I want to make an interface that slides into the screen.
    I have no idea how to make it, I tried looking at how the x and y coordinates are set in interface, but can't really find the thing I'm looking for.
    Code:
    public static void setBounds(int ID, int X, int Y, int frame,
    			RSInterface RSinterface) {
    		RSinterface.children[frame] = ID;
    		RSinterface.childX[frame] = X;
    		RSinterface.childY[frame] = Y;
    	}
    Code:
    private void drawInterface(int j, int k, RSInterface class9, int l) {
    		if(class9.interfaceType != 0 || class9.children == null)
    			return;
    		if(class9.interfaceShown && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
    			return;
    		int i1 = DrawingArea.clipStartX;
    		int j1 = DrawingArea.clipStartY;
    		int k1 = DrawingArea.clipEndX;
    		int l1 = DrawingArea.clipEndY;
    		DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
    		int i2 = class9.children.length;
    		boolean drawBlackBox = false;
    		for(int j2 = 0; j2 < i2; j2++) 	{
    			int k2 = class9.childX[j2] + k;
    			int l2 = (class9.childY[j2] + l) - j;
    
    			RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
    			if (class9_1 == null) {
    				System.out.println(j2+" -- " + class9.children[j2] );
    				return;
    			}
    			k2 += class9_1.xOffset;
    			l2 += class9_1.yOffset;
    			if(class9_1.contentType > 0 || class9_1.id > 31112 && class9_1.id < 31239) {
    				drawFriendsListOrWelcomeScreen(class9_1);
    			}
    
    			//here
    			int[] IDs = {
    					1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
    					1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
    					1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
    					1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
    					1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
    					/* Ancients */
    					12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
    					12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
    			};
    			for(int m5 = 0; m5 < IDs.length; m5++) {
    				if(class9_1.id == IDs[m5] + 1) {
    					if(m5 > 61)
    						drawBlackBox(k2 + 1, l2);
    					else
    						drawBlackBox(k2, l2 + 1);
    					drawBlackBox = true;
    					drawingBlackBox = true;
    				}
    			}
    
    			if (drawingBlackBox && (class9.id == 1151 || class9.id == 12855) && class9.children[j2] == 12854) {
    				continue;
    			}
    
    			int[] runeChildren = {
    					1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
    					1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
    					1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
    					1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
    					1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
    					1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
    					1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
    					1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
    					1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
    					12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
    					15885, 18474, 18475, 18478
    			};
    			for(int r = 0; r < runeChildren.length; r++)
    				if(class9_1.id == runeChildren[r])
    					class9_1.modelZoom = 775;
    
    			if(class9_1.interfaceType == 10) {
    				Sprite sprite;
    				if(interfaceIsSelected(class9_1)) {
    					sprite = class9_1.enabledSprite;
    				} else {
    					sprite = class9_1.disabledSprite;
    				}
    				if(sprite != null) {
    					sprite.drawSpriteOpacity(k2, l2, class9_1.opacity);
    				}	
    			}
    			if(class9_1.interfaceType == 0) {
    				drawOnBankInterface();
    				if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
    					class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
    				if(class9_1.scrollPosition < 0)
    					class9_1.scrollPosition = 0;
    				drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
    				if(class9_1.scrollMax > class9_1.height)
    					drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
    			} else if(class9_1.interfaceType != 1)
    				if(class9_1.interfaceType == 2) {
    					int i3 = 0;
    					for(int l3 = 0; l3 < class9_1.height; l3++) {
    						for(int l4 = 0; l4 < class9_1.width; l4++) {
    							int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
    							int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
    							if(i3 < 20) {
    								k5 += class9_1.spritesX[i3];
    								j6 += class9_1.spritesY[i3];
    							}
    
    							if(class9_1.inventory[i3] > 0) {
    								int k6 = 0;
    								int j7 = 0;
    								int j9 = class9_1.inventory[i3] - 1;
    								if(k5 > DrawingArea.clipStartX - 32 && k5 < DrawingArea.clipEndX && j6 > DrawingArea.clipStartY - 32 && j6 < DrawingArea.clipEndY || activeInterfaceType != 0 && anInt1085 == i3) {
    									int l9 = 0;
    									if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
    										l9 = 0xffffff;
    									Sprite Sprite_2 = ItemDef.getSprite(j9, class9_1.inventoryValue[i3], l9);
    									if(Sprite_2 != null) {
    										if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
    											k6 = super.mouseX - anInt1087;
    											j7 = super.mouseY - anInt1088;
    											if(k6 < 5 && k6 > -5)
    												k6 = 0;
    											if(j7 < 5 && j7 > -5)
    												j7 = 0;
    											if(anInt989 < 10) {
    												k6 = 0;
    												j7 = 0;
    											}
    											Sprite_2.drawSprite1(k5 + k6, j6 + j7);
    											if(j6 + j7 < DrawingArea.clipStartY && class9.scrollPosition > 0) {
    												int i10 = (anInt945 * (DrawingArea.clipStartY - j6 - j7)) / 3;
    												if(i10 > anInt945 * 10)
    													i10 = anInt945 * 10;
    												if(i10 > class9.scrollPosition)
    													i10 = class9.scrollPosition;
    												class9.scrollPosition -= i10;
    												anInt1088 += i10;
    											}
    											if(j6 + j7 + 32 > DrawingArea.clipEndY && class9.scrollPosition < class9.scrollMax - class9.height) {
    												int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.clipEndY)) / 3;
    												if(j10 > anInt945 * 10)
    													j10 = anInt945 * 10;
    												if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
    													j10 = class9.scrollMax - class9.height - class9.scrollPosition;
    												class9.scrollPosition += j10;
    												anInt1088 -= j10;
    											}
    										} else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
    											Sprite_2.drawSprite1(k5, j6);
    										else
    											Sprite_2.drawSprite(k5, j6);
    										if(Sprite_2.maxWidth == 33 || class9_1.inventoryValue[i3] != 1)
    										{
    											int k10 = class9_1.inventoryValue[i3];
    											smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
    											if(k10 >= 1)
    												smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
    											if(k10 >= 100000)
    												smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
    											if(k10 >= 10000000)
    												smallText.method385(0x00FF80, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
    										}
    									}
    								}
    							} else if(class9_1.sprites != null && i3 < 20) {
    								Sprite Sprite_1 = class9_1.sprites[i3];
    								if(Sprite_1 != null)
    									Sprite_1.drawSprite(k5, j6);
    							}
    							i3++;
    						}
    					}
    				} else if(class9_1.interfaceType == 3) {
    					boolean flag = false;
    					if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
    						flag = true;
    					int j3;
    					if(interfaceIsSelected(class9_1)) {
    						j3 = class9_1.enabledColor;
    						if(flag && class9_1.enabledHoverColor != 0)
    							j3 = class9_1.enabledHoverColor;
    					} else {
    						j3 = class9_1.disabledColor;
    						if(flag && class9_1.disabledHoverColor != 0)
    							j3 = class9_1.disabledHoverColor;
    					}
    					if(class9_1.opacity == 0) {
    						if(class9_1.boxFilled)
    							DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
    						else
    							DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
    					} else if(class9_1.boxFilled)
    						DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.opacity & 0xff), k2);
    					else
    						DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.opacity & 0xff), j3, class9_1.width, k2);
    				} else if(class9_1.interfaceType == 4) {
    					RSFont textDrawingArea = class9_1.rsFonts;
    					String s = class9_1.disabledMessage;
    					boolean flag1 = false;
    					if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
    						flag1 = true;
    					int i4;
    					if(interfaceIsSelected(class9_1)) {
    						i4 = class9_1.enabledColor;
    						if(flag1 && class9_1.enabledHoverColor != 0)
    							i4 = class9_1.enabledHoverColor;
    						if(class9_1.enabledMessage.length() > 0)
    							s = class9_1.enabledMessage;
    					} else {
    						i4 = class9_1.disabledColor;
    						if(flag1 && class9_1.disabledHoverColor != 0)
    							i4 = class9_1.disabledHoverColor;
    					}
    					if(class9_1.atActionType == 6 && aBoolean1149) {
    						s = "Please wait...";
    						i4 = class9_1.disabledColor;
    					}
    					if(DrawingArea.canvasWidth == 516) {//519
    						if(i4 == 0xffff00)
    							i4 = 255;
    						if(i4 == 49152)
    							i4 = 0xffffff;
    					}
    					//Magic interface
    					if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
    						switch (i4) {
    						case 16773120: i4 = 0xFE981F; break;
    						case 7040819: i4 = 0xAF6A1A; break;
    						}
    					}
    					//Skill interface
    					int id = 4004; int id2 = 4005;
    					if(class9_1.parentID == 3917 && class9_1.id != id && class9_1.id != id+2 && class9_1.id != id+4 && class9_1.id != id+6 
    							&& class9_1.id != id+8 && class9_1.id != id+10 && class9_1.id != id+12 && class9_1.id != id+14 && class9_1.id != id+16 
    							&& class9_1.id != id+18 && class9_1.id != id+20 && class9_1.id != id+23 && class9_1.id != id+24 && class9_1.id != id+26 
    							&& class9_1.id != id+28 && class9_1.id != id+30 && class9_1.id != id+32 && class9_1.id != id+34 && class9_1.id != 13926 
    							&& class9_1.id != 4152 && class9_1.id != 12166 && class9_1.id != id2 && class9_1.id != id2+2 && class9_1.id != id2+4 && class9_1.id != id2+6 
    							&& class9_1.id != id2+8 && class9_1.id != id2+10 && class9_1.id != id2+12 && class9_1.id != id2+14 && class9_1.id != id2+16 
    							&& class9_1.id != id2+18 && class9_1.id != id2+20 && class9_1.id != id2+23 && class9_1.id != id2+24 && class9_1.id != id2+26 
    							&& class9_1.id != id2+28 && class9_1.id != id2+30 && class9_1.id != id2+32 && class9_1.id != id2+34 && class9_1.id != 13927 
    							&& class9_1.id != 4153 && class9_1.id != 12167 && class9_1.id != 4026) {
    						if(i4 == 16776960)
    							i4 = 0x0000;
    						class9_1.textShadowed = false;
    					}
    					for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
    					{
    						if(s.indexOf("%") != -1)
    						{
    							do
    							{
    								int k7 = s.indexOf("%1");
    								if(k7 == -1)
    									break;
    								if(class9_1.id < 4000 || class9_1.id > 5000 && class9_1.id !=13921 && class9_1.id !=13922 && class9_1.id !=12171 && class9_1.id !=12172)
    									s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
    								else
    									s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
    							} while(true);
    							do
    							{
    								int l7 = s.indexOf("%2");
    								if(l7 == -1)
    									break;
    								s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
    							} while(true);
    							do
    							{
    								int i8 = s.indexOf("%3");
    								if(i8 == -1)
    									break;
    								s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
    							} while(true);
    							do
    							{
    								int j8 = s.indexOf("%4");
    								if(j8 == -1)
    									break;
    								s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
    							} while(true);
    							do
    							{
    								int k8 = s.indexOf("%5");
    								if(k8 == -1)
    									break;
    								s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
    							} while(true);
    						}
    						int l8 = s.indexOf("\\n");
    						String s1;
    						if(l8 != -1)
    						{
    							s1 = s.substring(0, l8);
    							s = s.substring(l8 + 2);
    						} else
    						{
    							s1 = s;
    							s = "";
    						}
    						if ((class9_1.id >= 18144) && (class9_1.id <= 18343)) {
    							int i22 = 0;
    							if (s1.startsWith("@cr")) {
    								i22 = Integer.valueOf(s1.substring(3, 4)).intValue();
    								s1 = s1.substring(5);
    								s1 = "  " + s1;
    								//((cz)localObject).a(rsi.an, i2, i11, str4, i17);
    								//textDrawingArea.method389(class9_1.textShadowed, i2, i4, s1, l6);
    								if (i22 > 0) {
    									//DrawingArea.setDrawingArea(256, 0, 463, 100);
    									clanChatIcons[i22].drawSprite(43, l6 - 10);
    								}
    							}
    						}
    
    						if (class9.children[j2] == 31159)
    							s1 = RSInterface.interfaceCache[31160].disabledMessage;
    
    						if(class9_1.textCentered)
    							textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadowed);
    						else
    							textDrawingArea.method389(class9_1.textShadowed, k2, i4, s1, l6);
    					}
    				} else if(class9_1.interfaceType == 5) {
    					Sprite sprite;
    					if ((class9_1.itemSpriteId1 != -1) && (class9_1.disabledSprite == null)) {
    						class9_1.disabledSprite = ItemDef.getSprite(class9_1.itemSpriteId1, 1, class9_1.itemSpriteZoom1 == -1 ? 0 : -1, class9_1.itemSpriteZoom1);
    						class9_1.enabledSprite = ItemDef.getSprite(class9_1.itemSpriteId2, 1, class9_1.itemSpriteZoom2 == -1 ? 0 : -1, class9_1.itemSpriteZoom2);
    						//if (class9_1.greyScale)
    						//if (class9_1.disabledSprite != null) class9_1.disabledSprite.greyScale();
    					}
    					if(interfaceIsSelected(class9_1))
    						sprite = class9_1.enabledSprite;
    					else
    						sprite = class9_1.disabledSprite;
    
    					if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) { 
    						sprite.drawSprite2(k2, l2, 0xffffff);
    					} else {
    						if(Autocast && class9_1.id == autocastId)
    							magicAuto.drawSprite(k2-1, l2);
    						if (sprite != null)
    							sprite.drawSprite(k2, l2);
    					}
    					if(sprite != null)
    						sprite.drawSprite(k2, l2);
    				} else if(class9_1.interfaceType == 6) {
    					int k3 = Rasterizer.centerX;
    					int j4 = Rasterizer.centerY;
    					Rasterizer.centerX = k2 + class9_1.width / 2;
    					Rasterizer.centerY = l2 + class9_1.height / 2;
    					int i5 = Rasterizer.SINE[class9_1.modelRotationY] * class9_1.modelZoom >> 16;
    					int l5 = Rasterizer.COSINE[class9_1.modelRotationY] * class9_1.modelZoom >> 16;
    					boolean flag2 = interfaceIsSelected(class9_1);
    					int i7;
    					if(flag2)
    						i7 = class9_1.enabledAnimation;
    					else
    						i7 = class9_1.disabledAnimation;
    					Model model;
    					if(i7 == -1) {
    						model = class9_1.method209(-1, -1, flag2);
    					} else {
    						Animation animation = Animation.anims[i7];
    						model = class9_1.method209(animation.anIntArray354[class9_1.animationLength], animation.anIntArray353[class9_1.animationLength], flag2);
    					}
    					if(model != null)
    						model.method482(class9_1.modelRotationX, 0, class9_1.modelRotationY, 0, i5, l5);
    					Rasterizer.centerX = k3;
    					Rasterizer.centerY = j4;
    				} else if(class9_1.interfaceType == 7) {
    					RSFont textDrawingArea_1 = class9_1.rsFonts;
    					int k4 = 0;
    					for(int j5 = 0; j5 < class9_1.height; j5++) {
    						for(int i6 = 0; i6 < class9_1.width; i6++) {
    							if(class9_1.inventory[k4] > 0) {
    								ItemDef itemDef = ItemDef.forID(class9_1.inventory[k4] - 1);
    								String s2 = itemDef.name;
    								if(itemDef.stackable || class9_1.inventoryValue[k4] != 1)
    									s2 = s2 + " x" + intToKOrMilLongName(class9_1.inventoryValue[k4]);
    								int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
    								int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
    								if(class9_1.textCentered)
    									textDrawingArea_1.method382(class9_1.disabledColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadowed);
    								else
    									textDrawingArea_1.method389(class9_1.textShadowed, i9, class9_1.disabledColor, s2, k9);
    							}
    							k4++;
    						}
    					}
    				} else if (class9_1.interfaceType == 8 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && anInt1501 == 100) {
    					int boxWidth = 0;
    					int boxHeight = 0;
    					RSFont textDrawingArea_2 = aTextDrawingArea_1271;
    					for (String s1 = class9_1.disabledMessage; s1.length() > 0;) {
    						int l7 = s1.indexOf("\\n");
    						String s4;
    						if (l7 != -1) {
    							s4 = s1.substring(0, l7);
    							s1 = s1.substring(l7 + 2);
    						} else {
    							s4 = s1;
    							s1 = "";
    						}
    						int j10 = textDrawingArea_2.getTextWidth(s4);
    						if (j10 > boxWidth) {
    							boxWidth = j10;
    						}
    						boxHeight += textDrawingArea_2.anInt1497 + 1;
    					}
    					boxWidth += 6;
    					boxHeight += 7;
    					int xPos = (l2 + class9_1.width) - 5 - boxWidth;
    					int yPos = k2 + class9_1.height + 5;
    					if (xPos < l2 + 5) {
    						xPos = l2 + 5;
    					}
    					if (xPos + boxWidth > j + class9.width) {
    						xPos = (j + class9.width) - boxWidth;
    					}
    					if (yPos + boxHeight > k + class9.height) {
    						yPos = (k + class9.height) - boxHeight;
    					}
    					DrawingArea.method336(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
    					DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
    					String s2 = class9_1.disabledMessage;
    					for (int j11 = yPos + textDrawingArea_2.anInt1497 + 2; s2.length() > 0; j11 += textDrawingArea_2.anInt1497 + 1) {//anInt1497
    						int l11 = s2.indexOf("\\n");
    						String s5;
    						if (l11 != -1) {
    							s5 = s2.substring(0, l11);
    							s2 = s2.substring(l11 + 2);
    						} else {
    							s5 = s2;
    							s2 = "";
    						}
    						textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
    					}
    				} else if (class9_1.interfaceType == 9) {
    					drawHoverBox(k2, l2, class9_1.disabledMessage);
    				}else if (class9_1.interfaceType == 10 && (anInt1500 == class9_1.id || anInt1044 == class9_1.id || anInt1129 == class9_1.id) && !menuOpen) {
    					int boxWidth = 0;
    					int boxHeight = 0;
    
    					TextDrawingArea textDrawingArea_2 = newRegularFont;
    					for (String s1 = class9_1.disabledMessage; s1.length() > 0;) {
    						int l7 = s1.indexOf("\\n");
    						String s4;
    						if (l7 != -1) {
    							s4 = s1.substring(0, l7);
    							s1 = s1.substring(l7 + 2);
    						} else {
    							s4 = s1;
    							s1 = "";
    						}
    						int j10 = textDrawingArea_2.getTextWidth(s4);
    						if (j10 > boxWidth) {
    							boxWidth = j10;
    						}
    						boxHeight += textDrawingArea_2.baseCharacterHeight + 1;
    					}
    					boxWidth += 6;
    					boxHeight += 7;
    					int xPos = (k2 + class9_1.width) - 5 - boxWidth;
    					int yPos = l2 + class9_1.height + 5;
    					if (xPos < k2 + 5) {
    						xPos = k2 + 5;
    					}
    					if (xPos + boxWidth > j + class9.width) {
    						xPos = (j + class9.width) - boxWidth;
    					}
    					if (yPos + boxHeight > k + class9.height) {
    						yPos = (k + class9.height) - boxHeight;
    					}
    					if(class9.isInventoryInterface)
    					{
    
    						if(xPos + boxWidth + j > 249)
    							xPos = 251 - boxWidth - j;
    						if(yPos + boxHeight + k > 261)
    							yPos = 245 - boxHeight - k;
    					}
    					DrawingArea.method336(boxHeight, yPos, xPos, 0xFFFFA0, boxWidth);
    					DrawingArea.fillPixels(xPos, boxWidth, boxHeight, 0, yPos);
    					String s2 = class9_1.disabledMessage;
    					for (int j11 = yPos + textDrawingArea_2.baseCharacterHeight + 2; s2.length() > 0; j11 += textDrawingArea_2.baseCharacterHeight + 1) {//anInt1497
    						int l11 = s2.indexOf("\\n");
    						String s5;
    						if (l11 != -1) {
    							s5 = s2.substring(0, l11);
    							s2 = s2.substring(l11 + 2);
    						} else {
    							s5 = s2;
    							s2 = "";
    						}
    						//  textDrawingArea_2.method389(false, xPos + 3, 0, s5, j11);
    						textDrawingArea_2.drawBasicString(s5, xPos+3,j11, 0, -1);
    					}
    				}
    		}
    		if ((class9.id == 1151 || class9.id == 12855))
    			if (!drawBlackBox) drawingBlackBox = false;
    		DrawingArea.setDrawingArea(l1, i1, k1, j1);
    	}
    Attached image
    Reply With Quote  
     

  2. #2  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    Code:
    private void drawInterface(int j, int k, RSInterface class9, int l) {
    literally pasted the code which draws the interface at x y, if its an interface component than you will need to edit the same method and the type that it is or add a new type
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Apr 2016
    Posts
    124
    Thanks given
    14
    Thanks received
    21
    Rep Power
    37
    k2 += class9_1.xOffset;

    that variable in your RSInterface adds an offset to the interface coordinates. simply make the xOffset increment periodically until a certain cap.
    Reply With Quote  
     

  4. #4  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Quote Originally Posted by Stuart View Post
    Code:
    private void drawInterface(int j, int k, RSInterface class9, int l) {
    literally pasted the code which draws the interface at x y, if its an interface component than you will need to edit the same method and the type that it is or add a new type
    Quote Originally Posted by NeedDump View Post
    k2 += class9_1.xOffset;

    that variable in your RSInterface adds an offset to the interface coordinates. simply make the xOffset increment periodically until a certain cap.
    Thanks, I tried it and it pasted the interface a lot of times, so I looked in project-exile to see how that login screen was done and I tried making it to work with interfaces, but it didn't.
    This is what I did:
    In RSInterface I made a new addInterface method called addSlideInterface. The difference is that I added a boolean
    Code:
    public static RSInterface addSlideInterface(int id) {
    		RSInterface tab = interfaceCache[id] = new RSInterface();
    		tab.id = id;
    		tab.parentID = id;
    		tab.interfaceType = 0;
    		tab.atActionType = 0;
    		tab.contentType = 0;
    		tab.width = 512;
    		tab.height = 700;
    		tab.opacity = (byte) 0;
    		tab.hoverType = -1;
    		tab.enableSlide = true;
    		return tab;
    	}
    Then I added this in drawInterface inside the interfaceType == 0 block:
    Code:
    if (class9_1.enableSlide) {
    					drawMovingInterface(12, 12, -190, 12, 10, 'x', class9_1.scrollPosition, class9_1);
    				} else
    					drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
    and this is the drawMovingInterface method:
    Code:
    public void drawMovingInterface(int finalCoordX, int finalCoordY,int startingX, int startingY, 
    			int speed, char coordToMove, int scrollPosition, RSInterface class9) {
    		if(!startedMoving) {
    			movingX = startingX;
    			movingY = startingY;
    			startedMoving = true;
    		}
    		if(!movedEnough) {
    			if(coordToMove == 'y')
    				movingY += speed;
    			if(coordToMove == 'x')
    				movingX += speed;
    			if(coordToMove == 'b') {
    				movingX += speed;
    				movingY += speed;
    			}
    			if((speed < 0 ? movingX <= finalCoordX : movingX >= finalCoordX) && (coordToMove == 'x' || coordToMove == 'b')) {
    				movingX = finalCoordX;
    				movedEnough = true;
    			}
    			if((speed < 0 ? movingY <= finalCoordY : movingY >= finalCoordY) && (coordToMove == 'y' || coordToMove == 'b')) {
    				movingY = finalCoordY;
    				movedEnough = true;
    			}
    			drawInterface(scrollPosition, coordToMove == 'y' ? startingX : movingX, class9, coordToMove == 'x' ? 
    					startingY : movingY);
    		} else
    		drawInterface(scrollPosition, coordToMove == 'y' ? startingX : movingX, class9, coordToMove == 'x' ? 
    				startingY : movingY);
    	}
    The problem is that it just opens that interface without moving.
    I can make it work using the original drawMovingSprite method, but then the text on the interface won't move along.
    Attached image
    Reply With Quote  
     

  5. #5  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Bump
    Attached image
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Oct 2015
    Posts
    136
    Thanks given
    3
    Thanks received
    7
    Rep Power
    11
    Try making the childs position based on the position of the interface. Like set ints X & Y to the base position of the interface, and set all childs to x + 15 or whatever.
    Reply With Quote  
     

  7. #7  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Quote Originally Posted by monsterbull v2 View Post
    Try making the childs position based on the position of the interface. Like set ints X & Y to the base position of the interface, and set all childs to x + 15 or whatever.
    So that means I have to redo the whole interface system?
    Attached image
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Oct 2015
    Posts
    136
    Thanks given
    3
    Thanks received
    7
    Rep Power
    11
    Quote Originally Posted by RememberM3 View Post
    So that means I have to redo the whole interface system?
    No, I mean setting the children for the interface you are trying to move using the x and y value of the main interface child.

    Code:
    int x= 10;
    int y = 15;
    
    rsi.child(0, 101, x, y);
    rsi.child(1, 102, x + 240, y + 9);
    Then again, I'm no expert in client sided work, so I could be wrong but that's what I would try.
    Reply With Quote  
     

  9. #9  
    Interfacing with your sister

    Streax's Avatar
    Join Date
    Jun 2009
    Posts
    2,308
    Thanks given
    784
    Thanks received
    175
    Rep Power
    229
    If I'm not mistaken, every time you update an interface, you have to redraw the interface. Also, instead of creating a new variable called "enableSlide", set your interface a unique action type. You may want to set the atActionType on the parent interface, or the "main" interface that holds all the children that you want to enable the sliding effect. Once you set the atActionType, find in the Client class where it checks for the action types, should look like small bits of code like if(l == ####) or similar. Then create a block of code for the specific action type, and handle the sliding inside of that block of code. redraw the main interface each time, so that it will update and appear to slide. I'm on vacation and away from my desktop, so I wont be able to assist you properly until I get home.
    Attached image
    Reply With Quote  
     

  10. #10  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Quote Originally Posted by Dev Az View Post
    If I'm not mistaken, every time you update an interface, you have to redraw the interface. Also, instead of creating a new variable called "enableSlide", set your interface a unique action type. You may want to set the atActionType on the parent interface, or the "main" interface that holds all the children that you want to enable the sliding effect. Once you set the atActionType, find in the Client class where it checks for the action types, should look like small bits of code like if(l == ####) or similar. Then create a block of code for the specific action type, and handle the sliding inside of that block of code. redraw the main interface each time, so that it will update and appear to slide. I'm on vacation and away from my desktop, so I wont be able to assist you properly until I get home.
    Thanks for you reply,
    This is what I did.
    I added this into the RSInterface class:
    Code:
    public static RSInterface addSlideInterface(int id) {
    		RSInterface rsi = interfaceCache[id] = new RSInterface();
    		rsi.id = id;
    		rsi.parentID = id;
    		rsi.interfaceType = 7;
    		rsi.width = 512;
    		rsi.height = 334;
    		return rsi;
    	}
    and I added this into the buildInterfaceMenu:
    Code:
    if(class9_1.interfaceType == 7)
    			{
    				for (int x = -190; x > 5; x++) {
    					buildInterfaceMenu(x, class9_1, k, j2, i1, class9_1.scrollPosition);
    					if(class9_1.scrollMax > class9_1.height)
    						method65(i2 + class9_1.width, class9_1.height, k, x, class9_1, j2, true, class9_1.scrollMax);
    				}
    			}
    but then the interface didn't show up at all, so I added the for loop into the interfaceType == 0
    and the interface did show up, but no movement at all.
    If you got any time to reply to this, that'd be awesome.
    Attached image
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. How do I make an Interface!
    By archsage78 in forum Help
    Replies: 3
    Last Post: 09-12-2009, 01:20 AM
  2. Help with making an interface?
    By nathan0507 in forum Help
    Replies: 1
    Last Post: 03-22-2009, 04:02 PM
  3. Replies: 2
    Last Post: 03-20-2009, 03:58 AM
  4. how to make an interface walkable
    By runescapedds in forum Requests
    Replies: 3
    Last Post: 12-24-2008, 04:32 PM
  5. Making an npc move
    By delta11 in forum Tutorials
    Replies: 5
    Last Post: 10-20-2007, 09:43 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •