RaptorSuitePaneHeaderSlots
Adds controls to the RAPTOR 3D pane header from tools outside the Suite.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | class | preview, 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 RaptorSuitePaneHeaderSlotsMethods
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.
| Parameter | Type | Description |
|---|---|---|
view | SceneView | The 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.
| Parameter | Type | Description |
|---|---|---|
rect | Rect | The rect in GUI coordinates of the current view. |
glyphName | string | An icon name. |
tooltip | string | Hover text, or null. |
on | bool | Whether 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.
| Parameter | Type | Description |
|---|---|---|
slot | Slot | The 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.
| Parameter | Type | Description |
|---|---|---|
slot | Slot | The 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.
| Parameter | Type | Description |
|---|---|---|
rect | Rect | Where, 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. |
text | string | The 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.
| Parameter | Type | Description |
|---|---|---|
text | string | The 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.
Related types
- RaptorSuitePaneHeaderSlots.Slot: Draws into a 3D pane's header, right to left.
- RaptorSuiteWindow: The RAPTOR Suite editor window.