Editor model · function

buildTreePanel

Fill into with one row per line of the tree's last rebuild.

function buildTreePanel(tree: SceneTree, into: UiNode): number
import { buildTreePanel } from '@driftengine/editor';

Parameters

ParameterTypeDescription
treeSceneTree
intoUiNode

In depth

The indent is padding rather than a spacer node, which halves the node count and means a hit test on a row covers the indent too — clicking to the left of a deep row's label selects that row, which is what every tree does and what a spacer would have broken.

Nothing here marks the selected row and UiNode grows no field for it. A selected flag on every node in every interface in every game, to serve a panel most of them never build, is the same trade this package refused when it put node names in SceneTree instead of on SceneNode. tree.rowOf(tree.selected) is the index, the caller already has the tree, and how a selected row looks is a decision about a consumer's palette rather than about an editor.