Unity UI Programming Layout & TextMesh Pro - Part 1 - Resizer and Anchors

Опубликовано: 04 Октябрь 2024
на канале: DesignerTech
608
9

First part of a series covering the theory of the RectTransform and how to use anchors, pivot, offsets and position to achieve flexible layout controls that can adapt to the parent UI object, screen resolution / orientation or be fixed. Techniques shown help control the aspects of UI layout with ways to pin panels, buttons, text to points of reference on the parent UI panel.

The Resizer component demonstrates how to manipulate the RectTransform using utility classes in the project I share below, on GitHub. The Resize also demonstrates how to recursively change an attribute of TextMesh Pro Text objects and this code can be copied/pasted to update all Text controls in a panel, including buttons and labels.

https://github.com/WazzaMo/unity-code...