Get RAPTOR

RaptorSuitePaneHeaderSlots

Adds controls to the RAPTOR 3D pane header from tools outside the Suite.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, since 0.1.0

RAPTOR Render's Ray-traced preview toggle and settings use these slots. Slots draw from right to left, just left of the shading buttons, and return their new right edge.

public static class RaptorSuitePaneHeaderSlots

Methods

ChipsCorner

public static Vector2 ChipsCorner(SceneView view)

Returns the room the 3D view's chips take in its top right corner, for a tool that draws along the view's top edge and keeps clear of them.

ParameterTypeDescription
viewSceneViewThe Suite window (a SceneView) whose 3D view is drawing.

Returns: In GUI points of the 3D view's scene GUI: x is from the view's right edge to the chips' left edge, y from its top edge to their bottom edge. Zero for any other window, or while the 3D view is hidden.

Call on the main thread.

IconToggle

public static bool IconToggle(Rect rect, string glyphName, string tooltip, bool on)

Draws a header icon button in the same style as the shading buttons.

ParameterTypeDescription
rectRectThe rect in GUI coordinates of the current view.
glyphNamestringAn icon name.
tooltipstringHover text, or null.
onboolWhether the button is on.

Returns: True when clicked.

Register

public static void Register(Slot slot)

Adds a slot. Adding the same delegate again does nothing.

ParameterTypeDescription
slotSlotThe slot.

Call from an [InitializeOnLoad] static constructor on the main thread. A slot that throws is logged and does not stop the others.

Unregister

public static void Unregister(Slot slot)

Removes a slot.

ParameterTypeDescription
slotSlotThe slot.

ViewText

public static void ViewText(Rect rect, string text)

Draws a line of text over the 3D view in the look of the view's own size numbers: white, the house Semi-bold, a dark outline, no plate behind it. Use it for a tool's read-only status in the view, so every number over the view reads as one family.

ParameterTypeDescription
rectRectWhere, in GUI coordinates of the view's scene GUI. The text is centred in it and is never clipped. Pass a rect of ViewTextSize's width to place its left edge.
textstringThe text. Nothing is shown for null or empty.

Call on the main thread, inside Handles.BeginGUI of a scene GUI pass. It draws on Repaint only and allocates nothing.

ViewTextSize

public static Vector2 ViewTextSize(string text)

Returns the size ViewText draws a text at.

ParameterTypeDescription
textstringThe text.

Returns: Width and height in whole GUI points at the current Interface scale. Zero for null or empty.

Call on the main thread, inside a GUI pass. It allocates nothing.