Stack Studio
A drag and drop interface for creating Plugin Menus
Stack Studio is a GUI for creating plugin user interfaces that appear before users in Nanome. A Nanome plugin usually contains 2 major components: plugin scripts and plugin UI. While the scripts contain the behavior and computation of the plugin, the plugin UI is what the user sees and accesses in Nanome software. To create a sophisticated Nanome plugin, it's very likely that you would need to both write the script and create the UI.
Get Started
You can send feedback to bugs@nanome.ai or chat with us in our Slack user group (https://nanome.ai/slack).
Download Stack Studio
Download Stack Studio and extract the zip file. If you can't extract it, an archiver such as 7-Zip can.
Once you extract the file, open Stack Studio from the extracted folder (StackStudio.exe on Windows). Once it's running, you'll see the interface below.

Create a JSON file at your preferred location. Copy the RMSD plugin menu JSON into the JSON file.
Open the File menu in Stack Studio and choose Import, then pick the JSON file that you just created.

- Once the JSON file is loaded, you'll see the interface below.

- This is the menu of Nanome's first-party plugin, RMSD. Try changing it to get a rough idea of how Stack Studio works.
Workspace

Menu View

Menu view renders a 2D interactable preview of the menu that you are creating. Any changes you make to the menu show up here right away. For interactable menu contents such as buttons and sliders, you can use your mouse to interact with them in the preview to check their visual behavior such as highlight color. However, since this is only a preview, interacting with the menu will not trigger any function.
Outline View

Nanome plugin UI is managed in a hierarchical fashion, and Outline view shows this hierarchy. Each component in the menu is called a node. A node can't be larger than its parent node. You can collapse or expand a node that contains multiple children nodes. The eye icon on a node toggles its visibility, and dragging a node moves it to a new parent.
Editor View

The Editor has options for a node's layout and content, and for the menu size. These options are organized into 3 tabs. Clicking a tab switches the view, and clicking a node in the Outline picks the node to edit.
Layout Tab

In the Layout tab, you can change the way children nodes are laid out under the node that you are editing.
Content Tab

In the Content tab, you can change the properties of a node's content. The properties that get displayed here depend on the type of the content. By default, a new node does not have any content. The Add Content button gives it content.

When a node is assigned a content type, you can view and edit its properties, such as name and padding. The picture above shows the properties of a button. UI Components describes each content type.
Window Tab

In the Window tab, you can change the menu window title and size. This tab changes the menu window properties, so it is independent from the node you selected to edit.
UI Components

When you add content to a new node, these are the contents currently available.
Button

Button is the fundamental interactable component of a plugin menu. When clicked on, a button sends an event to the plugin script with its name as payload. A button can include 5 sub-components, all of them optional: Text, Icon, Mesh, Outline, Tooltip. A button contains 5 states: Idle, Selected, Highlighted, Both, Unusable. You can customize the properties, such as color and visibility, of all 5 sub-components under all 5 states.
Mesh

Mesh is a solid chunk that serves as a background. You can customize its color.
Slider

Slider is an interactable component that sends the current slider position to the plugin script. It is useful in allowing the plugin user to change a value.
List

List is a two-dimensional grid of children nodes that have to be assigned and managed during runtime in the plugin script. It allows the plugin to dynamically generate a menu of contents.
Image

Image is a 2D image. You can change the image's color.
Label

Label is static text that users can't interact with.
Text Input

Text input is a text input field. The field's content is sent to the plugin script when the text is submitted.
Loading Bar

Loading bar is a horizontal bar that can be empty or filled by a solid color that represents progress. It is mainly used to indicate progress for plugins that can take a longer time to run.
Integrate a Plugin Menu
To integrate a menu made with Stack Studio into a plugin:
1. Export the plugin menu as a JSON file

Open the File menu and choose Export.
2. Place the exported JSON file in the folder where you are creating your plugin

Be sure to check that this is the same folder as the plugin script that you are writing.
Hotkeys
ctrl-n: spawn a new menu
n: add a node
c: add a content
1,2,3: switch tabs in the Editor
up, down: change selected node to the one above, below
left, right: change selected node to parent, child
ctrl-up, ctrl-down: move selected node up/down
ctrl-left, ctrl-right: deparent, parent selected node
ctrl-c, ctrl-x, ctrl-v: copy, cut, paste selected node
ctrl-shift-c, ctrl-shift-v: copy node to clipboard, paste node from clipboard
ctrl-s, ctrl-o: export, import
F2: rename selected node
delete, backspace: delete selected node