Get RAPTOR

RaptorSuiteMenu

The menu used by every RAPTOR dropdown, with icon and label rows, ticks, hotkeys and section headers.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, since 0.1.0

Inside a RAPTOR window the menu draws on an overlay above all other content and opens upwards from the bottom bar. Elsewhere it opens as a popup window. Choices run on the next editor tick. Modules open a menu with ShowDrawn and draw its rows with RaptorSuiteMenuCard.

public static class RaptorSuiteMenu

Methods

CloseDrawn

public static void CloseDrawn()

Closes the menu opened with ShowDrawn, if one is open. Does not exit the caller's GUI pass.

ShowDrawn

public static void ShowDrawn(Rect activator, float width, Func<float> height, Action<Rect> draw, Func<bool> live = null)

Opens a menu with a custom body instead of rows, using the same card and placement as other Suite menus. It stays open while its controls are used and closes on Esc or a click outside. Text fields in the body receive keyboard input, and a body taller than the available space scrolls. Draw its rows with RaptorSuiteMenuCard.

ParameterTypeDefaultDescription
activatorRectThe rect of the control the menu opens from, in GUI coordinates of the current view.
widthfloatThe card's width.
heightFunc<float>Returns the body's height. Called on every event, so the height can change.
drawAction<Rect>Draws the body in the given rect on every event, without a background.
liveFunc<bool>nullWhile this returns true, the card repaints 10 times a second, for live values. Pass null to turn this off.
  • RaptorSuiteMenuCard: Rows for a menu with a custom body (RaptorSuiteMenu.ShowDrawn), each ending in a switch, number field or segment.