Utility class to show and hide a Popup menu panel. Taken from Render Studio.
public class PopupMenu : object
Constructors
Create a PopupMenu instance.
Declaration
public PopupMenu(VisualElement content, VisualElement treeRoot, VisualElement anchor = null, Vector2 offset = null)
Parameters
Type |
Name |
Description |
VisualElement |
content |
The content that should be displayed as a popup.
|
VisualElement |
treeRoot |
The popup hierarchy root. The PopupMenu hierarchy is added as a child to this element.
|
VisualElement |
anchor |
The anchor for the element. If null, the PopupMenu will appear in the center of the screen
|
Vector2 |
offset |
Offset from the anchor if any, or the center of the screen.
|
Fields
Declaration
public bool exitOnClickOut
Field Value
Properties
Declaration
public VisualElement backDrop { get; }
Property Value
Type |
Description |
VisualElement |
|
Declaration
public VisualElement bubbleTail { get; }
Property Value
Type |
Description |
VisualElement |
|
Declaration
public PopupMenu.BubbleTailPosition bubbleTailPosition { get; }
Property Value
Declaration
public VisualElement container { get; }
Property Value
Type |
Description |
VisualElement |
|
Declaration
public bool isVisible { get; set; }
Property Value
Declaration
public VisualElement treeRoot { get; }
Property Value
Type |
Description |
VisualElement |
|
Methods
Hide the Popup Menu.
The content of the popup menu is not cleared here, to support animation in the future.
Declaration
Declaration
Events
Declaration
public event Action<bool> visibilityChanged
Event Type