nanome.api.ui.button module¶
Bases:
nanome._internal.ui.models._Button
,nanome.api.ui.ui_base.UIBase
Represents a clickable button on a menuBases:
nanome._internal.ui.models._ButtonIcon
- Whether or not the icon is visible
Type: bool
- The color of the image by button state.
Type: MultiStateVariable
- The position of the iconA position of (1, 1, 1) represents right, top, front,whereas (0, 0, 0) represents the middle.
Type: tuple
<float
,float
,float
>
- The ratio of height to height + width for the icon.A size of 0.5 represents equal width and height
Type: float
- The rotation of the icon about each axis.A position of (90, 90, 90) represents a quarter rotationabout each of the X, Y and Z axes, whereas (0, 0, 0) represents no rotation.
Type: tuple
<float
,float
,float
>
- The sharpness of the icon image (between 0 and 1)
Type: float
- The size of the icon imageA size of 1 represents the full size.
Type: float
- The file paths to the icon image by button state.
Type: MultiStateVariable
Bases:
nanome._internal.ui.models._ButtonMesh
- Whether or not the mesh is visible
Type: bool
- The color of the mesh by button state
Type: MultiStateVariable
- Whether or not the mesh is visible by button state
Type: MultiStateVariable
Bases:
nanome._internal.ui.models._ButtonOutline
- Whether or not the outline is visible
Type: bool
- The line thickness of the outline by button state
Type: MultiStateVariable
Bases:
nanome._internal.ui.models._ButtonSwitch
- Whether or not the button is visible
Type: bool
- The color for the button when it is off
Type: Color
- The color for the button when it is on
Type: Color
Bases:
nanome._internal.ui.models._ButtonText
- Whether or not the button text is visible
Type: bool
- Whether or not to automatically scale the font size of the textbased on the size of the button
Type: bool
- Whether or not the text is bold by button state
Type: MultiStateVariable
- The color of the text by button state
Type: MultiStateVariable
- Whether or not to use an ellipsis if there is too much text to display
Type: bool
- The horizontal alignment of the text
Type: HorizAlignOptions
- The space between lines of text
Type: float
- The maximum font size the text will displayThis is the upper bound for auto sizing.
Type: float
- The minimum font size the text will displayThis is the lower bound for auto sizing.
Type: float
- The padding below the text
Type: float
- The padding to the left of the text
Type: float
- The padding to the right of the text
Type: float
- The padding above the text
Type: float
- The font size of the text displayed
Type: float
- Whether or not the button text is underlined.
Type: bool
- The text displayed by button state
Type: MultiStateVariable
- The vertical alignment of the text
Type: VertAlignOptions
Bases:
nanome._internal.ui.models._ButtonTooltip
- The main textual content of the tooltip
Type: str
- Determines which part of the tooltip is closest to the button (target)Refers to the tooltip
Type: ToolTipPositioning
- Determines which side of the button the tooltip (origin) will appear onRefers to the tooltip’s button
Type: ToolTipPositioning
- The title of the tooltip
Type: str
Bases:
enum.IntEnum
Horizontal alignment modes for text.To be used with ui.Label().text_horizontal_align and ui.Button().horizontal_align
Bases:
nanome._internal.ui.models._MultiStateVariable
- Represents the highlighted state where the element is being hovered
Type: Any
- Represents the idle state where the element is not being hovered and is not selected
Type: Any
- Represents the highlighted state where the element has been selected
Type: Any
- Represents the selected, highlighted state where the element has been selected and is being hovered over
Type: Any
- Sets the value for every state
- Sets the value for each state
- Represents the unusable state where the element cannot be interacted with
Type: Any
Bases:
enum.IntEnum
Vertical alignment modes for text.To be used with ui.Label().text_vertical_align and ui.Button().vertical_align
- Whether or not to disable the button after it has been pressed once.
Type: bool
- The name of the button
Type: str
- Registers a function to be called when the button is hovered over
Parameters: func (method ( Button
) -> None) – called when a button is hovered over
- Registers a function to be called when the button is pressed/clicked
Parameters: func (method ( Button
) -> None) – called when a button is pressed
- Whether or not the button is selectedCorresponds to a potentially visually distinct UI state
Type: bool
- Whether or not to toggle the selected state of the button when it is pressed.
Type: bool
- Whether or not the button is unusableCorresponds to a potentially visually distinct UI state
Type: bool