devuiGuideDemosAPIGitHub

Arranging and windows

The code decides what exists; you decide where it's shown. None of this changes paths or values, and it's saved per page (separately from values).

From code: gui.layout.pin(path), createGroup(title, paths), addToGroup(id, path), moveChild(folder, node, index), openWindow({ folder }), clean(exists).

Windows

The panel, folder and group windows, and texture inspectors are all windows:

From code:

gui.openWindow('Scene/render', { dock: 'bottom' });  // or 'left', 'right', 'top'
gui.openWindow('Material', { beside: 'panel' });
gui.openWindow('Performance', { corner: 'top-left', size: { w: 260, h: 280 } });  // any corner
gui.openWindow('Scene/albedo');                       // a texture row: its inspector (a group: by its id)
// what windows docked full length along each edge cover, to keep your subject clear of them
gui.on('insets', ({ bottom }) => (canvas.style.height = `calc(100% - ${bottom}px)`));

What a folder's window can be dropped into is the folder's to say, with its drops hint: what it is (kind), and the kinds it takes (accepts). Unset, a folder is what its folder is and takes what its folder takes; at the top, a 'folder' that takes folders. Its own folders of its kind go back in.

// a tool: its window goes into no list (its own folder's neither: closing it puts it back), and
// nothing goes into it; the folders in it, its parts, go back only into it
gui.folder('Tools', { drops: { kind: 'tool', accepts: [] } });
// a shelf for tools as well as folders
gui.folder('Shelf', { drops: { accepts: ['folder', 'tool'] } });

A folder's window is a list: as tall as its rows, the height you give it at most. One whose rows are a tool that changes as you work in it (the frame capture, stepped through draw by draw) keeps the size you give it instead, its rows scrolling inside, with the window hint:

gui.folder('Inspector', { window: 'tool' });