Skip to content

Instantly share code, notes, and snippets.

@Gazzell
Last active January 31, 2018 16:54
Show Gist options
  • Save Gazzell/4486fe4bfe92908a0a3851c928cfc15a to your computer and use it in GitHub Desktop.
Save Gazzell/4486fe4bfe92908a0a3851c928cfc15a to your computer and use it in GitHub Desktop.
prints pixi.js node hierarchy in console (assuming nodes has 'name' property)
function printHierarchy(node, padding="") {
let newPadding = padding;
if (node.name) {
newPadding += " |";
console.log(`${padding}-${node.name}`);
}
node.children.forEach(child => printHierarchy(child, newPadding));
}
// Change APP.safeGetChildByName with the location of the pixi hierarchy
printHierarchy(APP.safeGetChildByName(""));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment