I am using GUILayout.BeginScrollView() to manage a list that i have positioned on the left side of the screen. The vertical scroll bar cuts in the middle of the screen. I would like to have the scroll bar on the left hand side of the list, can anyone give me some ideas on how to do this?
you can change it by using
GUI.BeginGroup
like this
private string longString = “”;
private Vector2 scrollPosition;
void OnGUI()
{
GUI.BeginGroup(new Rect(Screen.width/2, Screen.height/2, 500, 500));
scrollPosition = GUILayout.BeginScrollView(
scrollPosition, GUILayout.Width(300), GUILayout.Height(100));
GUILayout.Label(longString);
if (GUILayout.Button("Clear"))
longString = "";
GUILayout.EndScrollView();
if (GUILayout.Button("Add More Text",GUILayout.Width(100), GUILayout.Height(50)))
longString += "
Here is another line";
GUI.EndGroup();
}