Game Development Reference
In-Depth Information
Image types
The other option on the Image control, the Image Type property, opens up a wrath
of other options and capabilities. The options are:
• Simple
• Sliced
• Tiled
• Filled
Simple Images
As the type name suggests, this just presents the selected image or base color
within the bounds of the Rect Transform . Nothing fancy, just draws the image,
although you can use the shader material to affect how it's drawn and/or use
Effect components to alter the GameObject presentation.
Sliced Images
Slicing (or 9 slicing as it is sometimes called) is a method where you can define a
border within the bounds of your image, then that border will be preserved around
the edges of the Image GameObject's Rect Transform . In layman's terms, it allows
the border of an image to retain its aspect while the interior of the image will just be
stretched to fill its area. This ensures the border will always look the same no matter
the size of the image. (See Chapter 5 , Screen Space, World Space, and the Camera , for a
full example).
To define a border for an image, select it in your project's Asset view and then open
up the Sprite Editor using the Sprite Editor button in the inspector window (which
is now available for both Single and Multiple sprite images). When you open up
the editor and click in the area for the selected sprite (selected by default for single
images), you will see a green border surrounding the image at the top, bottom, left,
and right-hand sides, as you can see in the following screenshot:
Note: The corner picking points and the green border only show up
once you have added a border, either by dragging the four picking
points surrounding the image or by manually altering the border
dimension properties.
 
Search WWH ::




Custom Search