Game Development Reference
In-Depth Information
A limitation with the Tiled image at preset is that there is no way to alter
the scale of the source image used; it will simply be drawn using its native
size. Also if you use a
Sprite
with a border, the control will attempt to
also draw the border tiled, which gives some very unpredicable results
at present.
There isn't much more to say about the
filled
option. It does exactly what it says
on the tin. If you want images to tile from a different corner, then you will need to
rotate and flip the
Rect Transform
to put the desired corner where you wish.
Alternatively, you could create your own version of the Image
control and override the
filled
feature to give it a little more
flexibility. See
Chapter 6
,
Working with the UI source
, for more details.
Filled Images
The last
Image Type
option, the Image control is probably the most fascinating as it
mixes masking elements with a gradual fill to offer a way to gradually introduce an
image into the scene. When we set the
Image Type
to
Filled
we see the following in
the inspector window:
We see the familiar options as well as a few new ones, all of which you just have to
play with to get the real sense of this option. They include:
•
Fill Method
: This allows you to set the way in which the image is filled in,
from
Horizontal
or
Vertical
, to
Radial
in either a
90
,
180
, or
360
fashion
(see the following screenshot with an example of a
Radial360
fill)
•
Fill Origin
: This sets the position where the fill should start from, be it
Top
,
Bottom
,
Left
, or
Right
depending on the type of fill you select