Game Development Reference
In-Depth Information
Anchors Away
In the next two chapters, we start to work a lot more closely with our UI. Sure,
we can throw a bunch of controls at the screen and arrange them here and there,
but what happens when the screen resizes, the perspective changes, or it's run by
someone with an 80 inch screen; what happens to our UI then?
With game development, we usually take this into account with our game world, just
shrink and/or resize it to it the device. The same cannot be said however for our UI.
Text can become unreadable, and buttons may become too small or too big or even
become unusable. There truly isn't one size that fits all, or is there?
Through the new Anchoring system in Unity UI, we can finally build a dynamic and
responsive design that will look like the way we want it to, no matter the resolution
it is displayed in. This is then complemented very well with a scaling component
that slots straight onto our Canvases.
The following is the list of topics that will be covered in this chapter:
• Positioning
• Anchors
• Scaling UI with the Canvas Scaler
• Building a responsive health bar
• Attempting to sail our ship through dangerous waters
Dropping Anchor
I wonder whether I'll be able to keep up with the nautical theme for this entire chapter.
As we venture into this strange land, we can begin to look at what Unity gives us out
of the box and where to find all these Anchor settings before we delve into what they
really mean.
Search WWH ::




Custom Search