Game Development Reference
In-Depth Information
Remember, this is a 3D object like anything else. So, when
positioning it, position it in 3D space to get the view you want.
With these set up, let's add the
Text
and
Avatar
and we're done:
1.
Import an Avatar head from the
NobleAvatar
pack mentioned earlier
(make sure you set its
TextureType
to
Sprite
after importing).
2.
Right-click on the
AvatarArea
panel and select
UI
|
Image
and change its
Source Image
to the imported
Avatar
.
3.
Resize and position the
Avatar
over the empty hexagon on the
AvatarArea
.
4.
Right-click on the
TextArea
and add select
UI
|
Text
to add a
Text Component
.
5.
Resize the
Text Rect Transform
to fit comfortably within the
TextArea
.
6.
Set the
Text Color
to
White
.
Now, if we examine our creation, you will find it looks pretty awful:
• The images look grainy
• The text is massive
• If you set the
Font size
of the text down, it looks horrible
So just what is going on here? Why does this look so bad?
Troubles with scale
The simple answer to the previous question, is scale. If you check the size of the
Rect
Transform
of your
WorldSpaceCanvas
GameObject, you will see it is
100
pixels
wide by
100
pixels high; in other words, it's tiny in your massive 3D scene.
If you take any image and resize it down to a minute size, it will look awful and
cause all sorts of problems.
If you also recall, in a previous chapter, I noted that the text system hasn't changed in
Unity 4.6. It has its flaws and doesn't scale well, which is why it looks its worst in the
scene at the moment; the text needs to stay large (the larger, the better) to maintain
any kind of quality.
So, the simple answer to this is to think bigger!