Version: 2023.2
Panels
Coordinate and position systems

Draw order

The draw order of elements in the visual tree follows a depth-first search. Child visual elements appear on top of parent elements. UI Toolkit draws child elements in the order of the sibling list. The draw order is the following:

  1. 顶级视觉元素。
  2. 该视觉元素的第一个子元素。
  3. 后代元素的子元素。

The diagram below shows the draw order of a visual tree:

视觉元素绘制顺序
视觉元素绘制顺序

To change the draw order of visual elements in C#, use the following functions:

To change the draw order of sibling visual elements, use the following functions:

Panels
Coordinate and position systems