Game Development Reference
In-Depth Information
Ancient scrolls
As we enter the twilight of this chapter, we take a look at one last control,
the
Scrollbar
.
Personally I've always questioned the reason why the
Slider
and
Scrollbar
are separate controls They perform almost the same function
with only a few key differences. Maybe it's for further modularization
(the current
Scroll Rect
component will only use Scrollbar's and not
Slider's) or ties back to the legacy GUI, or even to maintain consistency
with other UI frameworks, who knows?
Where the
Scrollbar
differs from the
Slider
, is that it provides either a freeform
movement along the range (such as the
Slider
) or a fixed step movement, allowing
you to have fixed pages of content to view. It also has only one
Rect
Handle
by
default, as the GameObjects
Rect Transform
is used to set the bounds. Looking
at the
Scrollbar
in the editor, we see the following:
As you can see in the
Hierarchy
, it looks very similar to the
Slider
but a little more
cut down.