- Home /
ScrollBar on for loops
so i'm having this problem
OnGUI(){
GUILayout.BeginArea(new Rect(levelSelectXOffset, levelSelectYOffset, levelSelectWidth, levelSelectHeigth),"","box");
for(int j = 1;j<levels + 1;j++){
GUILayout.BeginHorizontal();
if(GUILayout.Button(j.ToString(),GUILayout.Width(325))){
Application.LoadLevel(j + "Level");
}
GUILayout.EndHorizontal();
}
}
So I want to have a scroll bar so when there are too many buttons and they begin to leave the screen i can use a scrollbar.
Ps all this displays good just need a scrollbar on the side
THX for the help.
Comment
Your answer
Follow this Question
Related Questions
Scrollbar Scroll Scale 1 Answer
ScrollRect scrollbar drag being overridden and stuttering to top 0 Answers
GUIlayout scrollbar, Not working well... 1 Answer
UGUI ScrollRect automatic scroll? (Chat) 1 Answer
Scrollbar Up/Down buttons 2 Answers