RaptorPropertiesUI
Draws Inspector rows that match RAPTOR's built-in rows.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | class | preview, since 0.1.0 |
public sealed class RaptorPropertiesUIFields
RowHeight
public const float RowHeight;The default row height in points.
Properties
EditingAllowed
public bool EditingAllowed { get; }Whether editing is currently allowed. False in Play mode or while the Suite blocks edits.
IsLayout
public bool IsLayout { get; }Whether the current GUI event is Layout. False outside a GUI callback.
Methods
Commit
public void Commit(Action command)Queues command to run after this GUI pass, if the selection and editing state are unchanged.
| Parameter | Type | Description |
|---|---|---|
command | Action | What to run. |
DragFloat
public void DragFloat(Rect field, string name, float value, RaptorStepRule rule, Action<float> commit)Draws a draggable number field with the panel's drag handle and delayed text entry. Apply edits from commit through Commit.
| Parameter | Type | Description |
|---|---|---|
field | Rect | The field's rect. |
name | string | The field's name, unique within the block. |
value | float | The current value. |
rule | RaptorStepRule | The step size and range. |
commit | Action<float> | Runs for every committed value. |
DragInt
public void DragInt(Rect field, string name, int value, RaptorStepRule rule, Action<int> commit)Draws a draggable whole-number field. See DragFloat.
| Parameter | Type | Description |
|---|---|---|
field | Rect | The field's rect. |
name | string | The field's name, unique within the block. |
value | int | The current value. |
rule | RaptorStepRule | The step size and range. |
commit | Action<int> | Runs for every committed value. |
Header
public bool Header(string key, string title, string icon = null)Draws a section header with a fold chevron and returns whether it is open. The fold state is stored under key with the panel.
| Parameter | Type | Default | Description |
|---|---|---|---|
key | string | The persistent fold key. | |
title | string | The header's title. | |
icon | string | null | Ignored; headers have no icon. Kept for compatibility. |
Returns: True when open.
LabelledRow
public Rect LabelledRow(string label, string icon = null)Draws a row with a label in the label column and returns the 24-point-tall field rect beside it.
| Parameter | Type | Default | Description |
|---|---|---|---|
label | string | The row's label. | |
icon | string | null | Ignored; rows have no icon. Kept for compatibility. |
Returns: The field's rect.
ReadoutLine
public void ReadoutLine(string text)Draws a muted one-line readout that counts as a row.
| Parameter | Type | Description |
|---|---|---|
text | string | The text. |
Repaint
public void Repaint()Requests a repaint of the panel.
Row
public Rect Row(float height = RowHeight)Reserves a full-width row of height points after the panel's row gap.
| Parameter | Type | Default | Description |
|---|---|---|---|
height | float | RowHeight | The row's height in points. |
Returns: The row's rect.
SegmentCell
public bool SegmentCell(Rect r, string icon, string label, bool active, bool? labelled = null)Draws an equal-width chip with an icon and label. When the label does not fit, only the icon is shown and the label shows on hover.
| Parameter | Type | Default | Description |
|---|---|---|---|
| r | Rect | The rect in GUI coordinates of the current view. | |
icon | string | An icon name, or null. | |
label | string | The chip's label. | |
active | bool | Whether the chip is selected. | |
labelled | bool? | null | Null shows the label when it fits; false draws the icon only. |
Returns: True when clicked.
SegmentFits
public bool SegmentFits(string label, float width)Whether a chip of width has room for label beside its icon.
| Parameter | Type | Description |
|---|---|---|
label | string | The chip's label. |
width | float | The chip's width. |
Returns: True when it fits.
Subheading
public void Subheading(string text)Draws a muted subheading inside the section.
| Parameter | Type | Description |
|---|---|---|
text | string | The text. |
Switch
public bool Switch(Rect area, bool on, float width, float height, bool mixed)Draws a compact switch at the right of area and returns the new state. When mixed is true, the knob is centred.
| Parameter | Type | Description |
|---|---|---|
area | Rect | The row's area. |
on | bool | The current state. |
width | float | The switch's width. |
height | float | The row's height in points. |
mixed | bool | Whether the state is mixed. |
Returns: The new state.
Related types
- RaptorStepRule: Step size and range for a draggable Properties number field.