Book Image

Unity3D UI Essentials

By : Simon Jackson
Book Image

Unity3D UI Essentials

By: Simon Jackson

Overview of this book

<p>Unity is a powerful cross-platform development engine that provides rich framework to create 2D and 3D apps or games. Through Unity3D, users are able take master the complexities of game development with ease, including animations, physics, renderings, shaders, scripting and now, Unity have released a new and advanced system to cope with the UI demands for modern applications and games.</p> <p>Unity 3D UI Essentials is a complete walk-through of the new UI system in Unity V4 and beyond (including Unity 5). This fast-paced practical tutorial provides you with in depth details of the new UI controls and layouts that can be used to create stunning and multiresolution UI.</p> <p>Venture forth into the highly componentized and advanced UI system, covering new features such as responsive designs and layouts. Also you get to deep-dive into the scripting side of the UI system as Unity has made the entire framework open source, giving free access to the source code of the new UI system to all developers.</p> <p>So get ready for a wild ride into the new Unity3D UI system and set your course for awesome!</p>
Table of Contents (14 chapters)

Ancient scrolls


As we enter the twilight of this chapter, we take a look at one last control, the Scrollbar.

Note

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.

In the Inspector, we see a very similar...