- Home /
Question by
Jasper1900 · Mar 24, 2014 at 04:51 PM ·
guicustomizationscrollbar
Can I customize my scrollbar in the GUI.BeginScrollviewFunction?
Hi,
While writing a GUI code I wanted to make my scrollbar smaller, but I didn't find a way to do this. I used the GUI.BeginScrollview method for my code, wich looks like this:
You can see that this scrollbar is way too big in comparison to my other GUI-elements. I was wondering if I could customize it, make it smaller or how to rewrite my code so it does dissappear.
Here is my code:
public float iconSize = 200;
void Update{
a = ((1/c)*iconSize);
}
void OnGUI () {
scrollPosition = GUI.BeginScrollView(new Rect(a, (Screen.height-(iconSize+a)), Screen.width/2, iconSize), scrollPosition, new Rect(0, 0, 7*(iconSize*a), 0));
GUI.Button(new Rect(0, 0, iconSize, iconSize), "Top-left");
GUI.Button(new Rect(iconSize+a, 0, iconSize, iconSize), "Bottom-left");
GUI.Button(new Rect(iconSize*2+2*a, 0, iconSize, iconSize), "Top-left");
GUI.Button(new Rect(iconSize*3+3*a, 0, iconSize, iconSize), "Bottom-left");
GUI.Button(new Rect(iconSize*4+4*a, 0, iconSize, iconSize), "Top-left");
GUI.Button(new Rect(iconSize*5+5*a, 0, iconSize, iconSize), "Bottom-left");
GUI.Button(new Rect(iconSize*6+6*a, 0, iconSize, iconSize), "Top-left");
GUI.Button(new Rect(iconSize*7+7*a, 0, iconSize, iconSize), "Bottom-left");
GUI.EndScrollView();
}
capture.png
(4.9 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613141045im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Is there a way to scroll GUI text WITHOUT scrollbars? 2 Answers
GUI sencitivity areas 1 Answer
GUI scrollbar help! 1 Answer
How do you get Old OnGUI Scripts to work with the New UI Scrollbars? 0 Answers
Scrollbar / BeginVertical GUI Issue 0 Answers