Unity_ugui Translations (3) Visual components

Source: Internet
Author: User

Visual components (Visual component)

There is new, and gameobjects that has been added with UI, that is, ease of creation and GUI specific fun Ctionality. This section would cover the basics of the new gameobjects that can be created.

New components and game objects are added to the UI system, their creation is simple, and specific GUI functionality can be used. In this section you will find the basic features of some of the newly added game objects.

Text

The text component, which is also known as a Label, have a text area for entering the text that would be displayed. It is possible to set the font, font style, font size and whether or not the text have rich text capability.

The text component has an input field, and the text entered here can be displayed, which is often used as a label. The text component can also set the font, font size, or whether the Rich Text option is selected

There is options to set the alignment of the text, settings for horizontal and vertical overflow which control what Happe NS If the text is larger than the width or height of the rectangle, and a best Fit option that makes the text resize to fi t the available space.

You can also set the alignment of the text by setting the horizontal and vertical alignment, and you can control how the text is displayed when it is longer than the width and length of the rectangle box. The best fit option allows text to automatically change text size to fit the text component space, depending on the length.

Image

A Toggle have a Rect Transform component and an Image component. A Sprite can be applied to the Image component under the Target Graphic field, and its colour can is set in the Color Fiel D. A material can also is applied to the Image component. The Image Type field defines how the applied sprite would appear, the options are:

Toggle (Image?) With a Rect transform component and an image component, the sprite picture can be placed in the target image input box (Source image) of the image assembly, and you can also select the color to set in the color bar, and a material ball can also be placed in the image component. The image Type Selection bar provides several different ways to display sprite images, which are as follows:

    • Simple-scales the whole sprite equally.

    • Display by original size
    • Sliced-utilises the 3x3 Sprite division so, resizing does not distort corners and only the center part is stretched.

    • Sliced-the sprite image into a 3x3 block, so that it is easy to change the size of the moment, the corners will not be changed, only the middle part will change depending on the size of the situation.
    • Tiled-similar to sliced, but tiles (repeats) the center part rather than stretching it. For sprites and no borders at all, the entire sprite is tiled.

    • tiled-and sliced are similar, except that the middle part takes the form not to change the size, but to repeat it. For sprite mutations without Borders, the entire picture is tiled.
    • Filled-shows the sprite in the same is simple does except, it fills in the sprite from the origin in a defined Di Rection, method and amount.

    • Filed-and simple take the same way to show the sprite picture, except that it can define the direction, method, and number of times the picture starts to show.

The option to Set Native Size, which are shown when simple or Filled are selected, resets the image to the original sprite s Ize.

When using the simple and filled modes, set Native size (set to original size) option, you can reset the picture to the original size

Images can imported as UI sprites by selecting sprites (2d/ui) from the ' Texture Type ' settings. Sprites has extra import settings compared to the old GUI Sprites, the biggest difference is the addition of the sprite E Ditor. The Sprite Editor provides the option of 9-slicing the image, this splits the image to 9 areas so if the sprite is Resized the corners is not stretched or distorted.

You can set it as a Sprite (2d/ui) in the texture type of the image so that the image can be imported as a UI sprite. This is more than the old GUI wizard has more import settings, the biggest difference is that a new wizard editor has been added, he has a nine Gong items, You can set the 9 areas of the picture, which are the corner position, and which are the center, so that the corners do not stretch when the image is resized.

Raw image (original image)

The Image component takes a sprite but Raw Image takes a texture (no borders etc). Raw Image should only be used if necessary otherwise Image would be suitable in the majority of cases.

The image component requires a Sprite picture, but the original picture requires a texture material (texture), but the texture should be borderless. Using Raw image is necessary unless the image is used in most cases

Mask

A Mask is not a visible UI control but rather a-modify the appearance of a control ' s child elements. The mask restricts (ie, "masks") the child elements to the shape of the parent. So, if the-the child is larger than the parent and then only the part of the fits within the parent would be visible.

Mask is not a visible UI controller, but is used to control the display of the size of the UI child object. Mask restricts the size of sub-objects to be limited to the parent object, and if the sub-object is larger than the parent, then only the part of the parent object can be seen.

Effects

Visual components can also has various simple effects applied, such as a simple drop shadow or outline. See the Effects Reference page for more information.

In Effects reference pages, you'll learn more about

Unity_ugui Translations (3) Visual components

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.