Logging Widget Trees

Summary

Published: Mar 31 2024 by mana vortex Last documented update: Apr 15 2024 by mana vortex

This page will tell you how to log widget trees and layer trees.

Wait, that's not what I want!

To learn more about logging, check Logging

Logging layer trees

You can find a list of existing UI layers on UI Scripting -> InkSystemLayers.

To traverse a layer's children, you first need to get the corresponding layer's virtual window:

private static func PrintLayerHierarchy(layerName: CName) {
    let window = GameInstance.GetInkSystem().GetLayer(layerName).GetVirtualWindow();
    let rootWidget = window.GetWidgetByPathName(n"Root") as inkCanvas;
    // The function LogWidgetTree is defined below
    LogWidgetTree(n"DEBUG", rootWidget);
}

PrintLayerHierarchy(n"inkHUDLayer")

Logging Widget Trees

Big thanks to Rayshader for walking me through this with the patience of a saint!

You can add this code to your logs.reds file:

Last updated

Was this helpful?