This is the 18th day of my participation in the August Genwen Challenge.More challenges in August

👉 About the author

As we all know, life is a long process of constantly overcoming difficulties and reflecting on progress. In this process, there will be a lot of questions and thoughts about life, so I decided to share my thoughts, experiences and stories to find resonance!! Focus on Android/Unity and various game development tips, as well as various resource sharing (websites, tools, materials, source code, games, etc.)

👉 about to learn

Learn about FairyGUI in Unity from start to finish

👉 background

Unity 2019 x series

FairyGUI 2021.2 series

👉 Practice

Reference/search/console

Reference: query a resource reference by another resource, or query a resource reference by another resource, the key is that can also replace, 6 very

Search: Enter keywords to retrieve relevant content

Console: displays software prompt information, including prompt information, warning information and error information.

Test interface:

When you want to see how it works, click the Test button in the main toolbar or run F5

You can set global adaptation parameters, modify device preview, vertical and horizontal screen, and other operations. At that time, we should pay attention to the dynamic effect playing process, do not change the screen size, otherwise there will be abnormal.

Project Settings

The default value

Note: These parameters are default values in the editor and are runtime independent. The global Settings need to be reconfigured using UIConfig at run time. And the Settings in the latter need not be the same as here.

Font: Change the default font for all text, either using the font in your project (TTF file) or using the system’s own font (whatever font is under C:\Windows\Fonts on your computer)

Font color/size: Sets the default color and size for new text in the stage (central action area)

Default axis: the origin of coordinates, default upper left corner can be

Vertical scroll bar/horizontal scroll bar: Sets the scroll bar resources used by all containers with scroll function when making UI. This means that when you set a component or list’s “overflow handling” to “vertical scroll,” “horizontal scroll,” or “free scroll,” you automatically use the scroll bar resources set here without having to set the scroll bar each time. If a component needs to use a scroll bar that is different from the global setting, drag the current component to override it. Both global and individual Settings are supported.

Button click sound: Sets the default click sound of a button. Once this is set, all button clicks will play this sound effect unless the button itself sets another sound effect. This setting is only used in the editor and is set at runtime using UIConfig. ButtonSound.

The shortcut menu

After this setting, when you change font size, color or style anywhere, you don’t need to set it, just use the drop down menu.

Project branch

This section is important for some projects.

Branch function is used to achieve polymorphic design, such as the multi-language version of the UI differences, in addition to the basic text of the Chinese and English differences, there are pictures of art words in Chinese and English differences, to ensure that the resource name is consistent, which is consistent with the idea of Android.

We are all developing on the trunk, and we can create as many branches as we want at any time, and then add something different to the branches

Note that this is not the same concept as branching in the code repository. The UI branch does not contain the trunk’s resources; it only places content that differs from the trunk, reducing the resource capacity

See the official documentation tutorial for details

Publish Settings

Texture set

When publishing, the editor will group the image resources in the project together, and automatically paginate them when they are too large, as shown in the picture

This change will affect the size of the published texture set, generally the default is ok, you can modify to see what effect it has, except for the published path you change, other content generally keep the default.

Is it really that simple? Small empty is also very smooth at the beginning, behind the resources also began to jump out a lot of problems:

Problem # 1: Gif sequence frames are split between two texture sets, requiring Gif frames to be in one texture set, the editor will tell you when you publish: publish failed, the animation is automatically published to different texture sets, which causes……

To solve this, we just need to change the Gif to a separate texture set (double click to bring up the Settings). Gif is animated in the editor, see the animation section of this series for details.

Problem two: further in-depth problem came again, a game, no matter how small he also has a lot of resources. Texture set Settings are 2048 x 2048 pixels by default (modifiable in publishing Settings), with the exception of larger sizes (4096 pixels? Or 8192 pixels?) . Publish it and run it in Unity and you’ll see, oh my God, why is it blurred? UI bifurcated the graph? No, it looks fine in FairyGUI. Is the problem with Unity?

Yes, the default texture set you publish in Unity is 2048. You’ve changed it to a higher pixel and are parsing it at 2048. Only need to modify the maximum size corresponding.

Question three: Think this is the end? Also can go deep again, this small empty is really pit a. Even if you set that up, open your titanium eyes and look closely, you can still see something uncomfortable: there may be a bit of a “grey edge” in parts, which is missing in FairyGUI.

If you look at the right part of the image, there is a compression option. The default Unity texture set is normal compression, you can change it to None.

The reader, who is learning FairyGUI for the first time, will be left wondering why. That’s ok. Read on, and you’ll find out when you’re done with this tutorial.

Today the small empty has learned this, we will see you next time!!

👉 other

📢 author: Xiaokong and Xiaoshi nakoko 📢 Reprint: be sure to indicate the source: Zhimen’s personal homepage (juejin. Cn). 📢 welcome to like 👍 collect 🌟 message 📝