nanome.api.ui.layout_node module

class LayoutNode(name='node')[source]

Bases: nanome._internal.ui.models._LayoutNode

Class for hierarchical UI objects representing part of a Nanome menu.
Layout nodes are used to create menus, by defining where one UI element should be placed relative to another.
One LayoutNode can contain one interactive UI element as well as any number of child Layout Nodes.
Parameters:name (str) – Name of the node, used to identify it and find it later
class LayoutTypes

Bases: enum.IntEnum

Orientation modes for Layout Nodes.
To be used with ui.LayoutNode().layout_orientation
horizontal = 1
vertical = 0
class PaddingTypes

Bases: enum.IntEnum

UI padding types.
To be used with ui.LayoutNode().padding_type
fixed = 0
ratio = 1
class SizingTypes

Bases: enum.IntEnum

Ways in which a Layout Node can be sized within a UI layout.
To be used with ui.LayoutNode().sizing_type
expand = 0
fixed = 1
ratio = 2
add_child(child_node)[source]
add_new_button(text=None)[source]
add_new_dropdown()[source]
add_new_image(file_path='')[source]
add_new_label(text=None)[source]
add_new_list()[source]
add_new_loading_bar()[source]
add_new_mesh()[source]
add_new_slider(min_value=0, max_value=10, current_value=5)[source]
add_new_text_input(placeholder_text='')[source]
add_new_toggle_switch(text=None)[source]
children
clear_children()[source]
clone()[source]
content
create_child_node(name='')[source]
enabled
Defines if layout node is visible.
If disabled, it will not influence the menu layout.
Type:bool
find_ancestor(name)[source]
find_node(name, recursively=True)[source]
Checks child nodes for a node of the matching name.
If “recursively” is True, this also checks all descending nodes.
Parameters:name (str) – Name of the node to find.
Returns:LayoutNode with matching name
Return type:LayoutNode
forward_dist
Sets the depth distance (towards camera) of a node, relative to its parent
Type:float
get_children()[source]
get_content()[source]
io = <nanome.api.ui.io.layout_node_io.LayoutNodeIO object>
layer
The node layer. A node on layer 0 and another on layer 1 will be on different layouts, possibly overlapping
Type:int
layout_orientation
Defines if children node should be arranged vertically or horizontally
Type:LayoutOrientation
name
Name of the node, used to identify it and find it later
Type:str
padding
padding_type
The padding type of the LayoutNode.
Type:PaddingTypes
parent
remove_child(child_node)[source]
remove_content()[source]
set_content(ui_content)[source]
set_padding(left=None, right=None, top=None, down=None)[source]
set_size_expand()[source]
set_size_fixed(size)[source]
set_size_ratio(size)[source]
sizing_type
Defines how the node size in the layout should be calculated
Type:SizingTypes
sizing_value
Size of the node in its layout.
Behavior is different depending of sizing_type
Type:float