Creating UI with the UI Builder
To create UI with the UI Toolkit, you have to create a UI Document to describe what Visual Elements you will render as well as their layout and other properties. There are two ways to create UI Documents within the UI Toolkit system:
- Write the code that will lay out the Visual Elements
- Lay the elements in UI Builder and have it write the code for you
You can also do a combination of both and bounce between editing your UI via code or the UI Builder.
To access the UI Builder, select Window | UI Toolkit | UI Builder.
Figure 18.12: The UI Builder window
In this window, you can drag and drop various Visual Elements from the Library (bottom left) into the Viewport (center). You can resize and move the Visual Elements around in this Viewport, as well. You can change the parenting, thus changing how the Visual Element is aligned via the Hierarchy (left center). Additionally, you can also view the code file...