This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

SkillTreeGUI

By: a guest on Jan 26th, 2013  |  syntax: JavaScript  |  size: 1.29 KB  |  views: 31  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function OnGUI()
  2. {      
  3.         if(displayed)
  4.         {      
  5.                 GUI.skin = skillInfoStyle;
  6.                
  7.                 var posBookX:float = Screen.width/2 -960/2;
  8.                 var posBookY:float = Screen.height/2 -960/2;
  9.                 var sizePageX:int = 960/2-150;
  10.                 var sizePageY:int = 960-310-250;
  11.                 var rectTree:Rect = new Rect(posBookX+960/2+50, posBookY+350, sizePageX, sizePageY);
  12.                 var sizeCase:int = 64;
  13.                
  14.                 var posCaseX:int[] = new int[5];
  15.                 var posCaseY:int[] = new int[5];
  16.                 var posCaseYBase:int = 100;    
  17.                 posCaseX[0] = sizePageX/6;      //Offensif 1
  18.                 posCaseY[0] = posCaseYBase;    
  19.                 posCaseX[1] = sizePageX/6;      //Offensif 2
  20.                 posCaseY[1] = posCaseYBase*2;
  21.                 posCaseX[2] = sizePageX/2;      //Defensif 1
  22.                 posCaseY[2] = posCaseY[0];
  23.                 posCaseX[3] = sizePageX/2;      //Defensif 2
  24.                 posCaseY[3] = posCaseY[1];  
  25.                 posCaseX[4] = sizePageX/3;      //Defensif/Offensif
  26.                 posCaseY[4] = posCaseYBase*3;
  27.                
  28.                 GUI.BeginGroup(rectTree);  //From here, nothing shows up
  29.                 print("ok"); //This message works perfectly fine
  30.                 GUI.Box(new Rect(0,0,960,960),"");
  31.                
  32.                 for(i = 0; i < fireSkills.length; i++)
  33.                 {
  34.                         GUI.DrawTexture(new Rect(posCaseX[i], posCaseY[i]-posCaseYBase/2, sizeCase, sizeCase), caseST);
  35.                         GUI.Button(new Rect(posCaseX[i], posCaseY[i]-posCaseYBase/2, sizeCase, sizeCase), "");
  36.                 }
  37.                
  38.                 GUI.EndGroup(); //From here, everything works fine
  39.                
  40.         }
  41. }
clone this paste RAW Paste Data