Game Development Reference
In-Depth Information
If we look at the
Scroll Rect
in the
Inspector
, we will see the following:
From the previous screenshot we have:
•
Content
: This defines the
Rect Transform
that contains the content to be
managed by the
Scroll Rect
; it doesn't have to be a
Layout Group
, it can be
any other
UI
control that needs a scrollable area. It should have dimensions
larger that the
Scroll Rect
to work properly.
•
Horizontal/Vertical
: These options allow you to enable or restrict the
scrolling direction for the
Content
area. Useful if you want just a vertical
or horizontal swiping area.
•
Movement Type
: With the
Movement Type
, you can control how the user
interacts with the scrollable area:
°
Unrestricted
: Moves and keeps on moving without restriction
(even off the screen where you cannot get hold of it again)
°
Elastic
: Moves with an elastic motion, which snaps back if it goes
beyond the scrollable area
°
Clamped
: Moves in a fix motion within the scrollable area, and stops
as soon as it hits the edges
•
Inertia
: Applies a physical force to the scrollable movement, both how
fast it moves initially and how quickly it slows down. You can also set a
Deceleration Rate
for how fast the scroll slows down.