Drawing lines in UIDocument

Using borders is one way of getting vertical or horizontal lines. If you want more custom drawing, you can use the generateVisualContent callback to generate a custom mesh using the MeshApi.

If you’re one 2020.1 and above, you can install the com.unity.ui package to see it in action.
See this post on how to install the package:

Once you have the package installed, in the PackageManager window, select the com.unity.ui package and install the samples. Then, a demo of the mesh api is located in window>UI Toolkit>Rendering>Mesh API

1 Like