Hallo people.
I need help with my quest log. If i get a new quest. he must stand under the older quests.
I thought it was something with arrays? maybe I was right but I failed to get anything out of it.
i have a quest log with buttons.
can anyone help?
script:
var qlog = false;
var qname : String = ""; var qtext : String = ""; private var scrollPosition = Vector2.zero; private var scrollPosition2 = Vector2.zero; var windowRect = Rect (200, 200, 200, 300);
function Update() { quest = new String[10]; if(Input.GetKeyDown("q")) { qlog = true; } }
function OnGUI() { if(qlog) { windowRect = GUI.Window (0, windowRect, DoMyWindow, ""); } }
function DoMyWindow (windowID : int) { if(qlog) { GUI.Box(Rect(0,0,200,300), "Quest Log"); scrollPosition = GUI.BeginScrollView (Rect (50,30,130,100), scrollPosition, Rect (0, 0, 0, 200)); if(GUI.Button (Rect (0,0,100,20), "Quest 1")) { qname = "here comes the name"; qtext = "Here come the info from the quest"; } if(GUI.Button (Rect (0,20,100,20), "Quest 2")) { qname = "Quest 1"; qtext = "Here is the example helpefull? i hope so >:)"; } GUI.Button (Rect (0,40,100,20), ""); GUI.Button (Rect (0,60,100,20), ""); GUI.Button (Rect (0,80,100,20), ""); GUI.Button (Rect (0,100,100,20), ""); GUI.Button (Rect (0,120,100,20), ""); GUI.Button (Rect (0,140,100,20), ""); GUI.Button (Rect (0,160,100,20), ""); GUI.Button (Rect (0,180,100,20), "");
// End the scroll view that we began above.
GUI.EndScrollView ();
GUI.Label(Rect(40,150,200,200),""+qname);
scrollPosition2 = GUI.BeginScrollView (Rect (40,170,140,100),
scrollPosition2, Rect (0, 0, 0, 150));
GUI.Label(Rect(0,0,120,250),""+qtext);
GUI.EndScrollView ();
if(GUI.Button(Rect(180,0,17,17),"X"))
{
qlog = false;
}
}
GUI.DragWindow (Rect (0,0, 10000, 20));
}
i way it dont show the wholl code as a code here srry for that :(