- Home /
This post has been wikified, any user with enough reputation can edit it.
dialog multi anglet
I'm trying to make a multi-tab dialog box when I click on a button every other button decreases in size except the one clicé here is the code
public class Multi_Chat : MonoBehaviour {
public static bool showChat = false;//vraible d'affiche de boite de chat
private Vector2 scrollPosition ;//définition de barre de déroulement
private Vector2 scrollPosition1 ;//définition de barre de déroulement
private Rect window = new Rect(50, 50, 200, 300);//fêntre de chat
private string chat = "";
private string message = "";
string[] values = new string[] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
int a=100;
int b=40;
void OnGUI () {
window = GUI.Window (5, new Rect(50, 50, 500, 400), GlobalChatWindow, "Chat avec "+ShowMessage.destinataire_name);
}
void GlobalChatWindow (int id) {
scrollPosition1 = GUILayout.BeginScrollView(scrollPosition1,true,false,GUILayout.Width(600),GUILayout.Height(70));
for(int n = 0; n < values.Length; n++)
{
int y=88*n;
if (GUI.Button(new Rect(y+10*n, 10, a, b),values[n]))
{
}
}
GUILayout.EndScrollView ();
scrollPosition = GUILayout.BeginScrollView (scrollPosition);
GUILayout.Label(chat);
GUILayout.EndScrollView ();
GUI.SetNextControlName("message");
message = GUILayout.TextField(message);
GUI.DragWindow();
}
Comment
Your answer