Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - wana7262

Pages: [1]
1
NGUI 3 Support / GUI to NGUI
« on: August 03, 2014, 02:58:53 AM »
Hi all, i am trying to convert Unity's GUI to NGUI but stuck...!!! i want to show list of available servers in game using NGUI but unable to convert and display it on scrollview items
here is the script
  1. function OnGUI()
  2. {
  3. //      set up scaling
  4.     var rx : float = Screen.width / native_width;
  5.     var ry : float = Screen.height / native_height;
  6.     GUI.matrix = Matrix4x4.TRS (Vector3(0, 0, 0), Quaternion.identity, Vector3 (rx, ry, 1));
  7.  
  8.  
  9. //      if(GUI.Button(RefreshR, "refresh",Buttonzs)){
  10. //              Debug.Log("Requesting Masterserver list from: " + ServerName);
  11. //              MasterServer.RequestHostList(ServerName);
  12. //      }
  13.         GUI.skin = mySkin;
  14.         GUIUtility.RotateAroundPivot (rotAngle, pivotPoint);
  15.         scrollPosition = GUI.BeginScrollView (ScrollR,scrollPosition, ScrollW);
  16.         //GUI.BeginGroup (GroupArea);
  17.         //GUILayout.BeginArea(AreaR,"", "");
  18.         //GUILayout.Label("available servers",Lay);
  19.                 for (var match : HostData in MasterServer.PollHostList())
  20.                 {
  21.                         GUILayout.BeginHorizontal("Box");
  22.                        
  23.                         GUILayout.Label (match.gameName,Lay);
  24.                         GUILayout.Space(5);
  25.                         GUILayout.Label (curMapName,Lay);
  26.                         Debug.Log(match.ToString());
  27.                         if(GUILayout.Button ("Connect",Buttonzs))
  28.                         {
  29.                                 Network.Connect(match);
  30.                         }
  31.                         GUILayout.EndHorizontal();
  32.                 }
  33.                
  34.                 //GUILayout.EndArea();
  35.                 //GUI.EndGroup();
  36.                 GUI.EndScrollView ();
  37. }

Thanks in Advance

2
Thanks working Now :)

3
i used this method but when i click on any item it move upwards
  1. void OnClick()
  2.         {
  3.                
  4.                 SpringPanel.Begin(dragPanel.gameObject, -transform.localPosition, 8f);
  5.         }


4
how can i do it?
any noob help? i am using the sample scroll panel...i want to center the panel content on click..help plz

Pages: [1]