Game Development Reference
In-Depth Information
From the preceding code, we can see that the
GUI.BeginScrollView()
function re-
turns
Vector2
, which is the vertical and horizontal position of this scroll view. It also
takes two
Rect
objects; the first
Rect
object is the area that the player will see, or we
can call it a mask area. The second
Rect
object is the area of our content, which is based
on the content that we included between the
GUI.BeginScrollView()
and
GUI.EndScrollView()
functions, which are the three lines of
GUI.Button
. We
can see more details of this function at the following URL:
The following figure shows how the
GUI.BeginScrollView()
function works in a
visual representation: