- Home /
How can I scale the insides of a ScrollView
Hi.
In my Editor GUI code I use
scrollPosition = GUI.BeginScrollView(...)
// Draw my GUI
GUI.EndScrollView();
But what I would like to achieve is to dynamically change the scale of everything inside the scroll view. Something akin to
scrollPosition = GUI.BeginScrollView(...);
GUI.matrix = Matrix4x4.Scale(new Vector3(0.5f, 0.5f, 1));
// Draw GUI
GUI.matrix = Matrix4x4.Scale(Vector3.one);
GUI.EndScrollView();
My problem is that the gui is cut off inside the scroll view at excactly half the width and height. What am I doing wrong?
Comment
Did you ever figure this out? I've read in other threads that this isn't possible since the scaling happens after the clipping...
Same result here. I thought I'd try something smart and tried scaling the scrollview up by the inverse amount that I was scaling the contents down, but that doesn't work either, because apparently the scrollview can't be bigger then the available screen-area, so I got a few more pixels, but still no workable solution. :(