i want to make a window which inside contain Label & Text Field. I use window because it can be Drag to any position that the player wants. Is this possible? or perhaps is there any other method that i can use to get exactly what i want?
my code here, i put the Text Field & Label inside DoMyWindow(). It does appear but it wont work.
using UnityEngine;
using System.Collections;
public class panelProperties : MonoBehaviour {
string pos,rot="";
Rect windowRect0 = new Rect(20, 20, 200, 100);
void OnGUI() {
windowRect0 = GUI.Window(0, windowRect0, DoMyWindow, "Red Window");
}
void DoMyWindow(int windowID) {
GUI.Label(new Rect(10, 20, 100, 20), "Position:");
pos = GUI.TextField(new Rect(70, 20, 100, 20), "", 25);
GUI.Label(new Rect(10, 45, 100, 20), "Rotation:");
rot = GUI.TextField(new Rect(70, 45, 100, 20), "", 25);
GUI.DragWindow();
}
}