Get RAPTOR

RaptorPropertiesUI

Draws Inspector rows that match RAPTOR's built-in rows.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, since 0.1.0
public sealed class RaptorPropertiesUI

Fields

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.

ParameterTypeDescription
commandActionWhat 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.

ParameterTypeDescription
fieldRectThe field's rect.
namestringThe field's name, unique within the block.
valuefloatThe current value.
ruleRaptorStepRuleThe step size and range.
commitAction<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.

ParameterTypeDescription
fieldRectThe field's rect.
namestringThe field's name, unique within the block.
valueintThe current value.
ruleRaptorStepRuleThe step size and range.
commitAction<int>Runs for every committed value.
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.

ParameterTypeDefaultDescription
keystringThe persistent fold key.
titlestringThe header's title.
iconstringnullIgnored; 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.

ParameterTypeDefaultDescription
labelstringThe row's label.
iconstringnullIgnored; 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.

ParameterTypeDescription
textstringThe 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.

ParameterTypeDefaultDescription
heightfloatRowHeightThe 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.

ParameterTypeDefaultDescription
rRectThe rect in GUI coordinates of the current view.
iconstringAn icon name, or null.
labelstringThe chip's label.
activeboolWhether the chip is selected.
labelledbool?nullNull 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.

ParameterTypeDescription
labelstringThe chip's label.
widthfloatThe chip's width.

Returns: True when it fits.

Subheading

public void Subheading(string text)

Draws a muted subheading inside the section.

ParameterTypeDescription
textstringThe 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.

ParameterTypeDescription
areaRectThe row's area.
onboolThe current state.
widthfloatThe switch's width.
heightfloatThe row's height in points.
mixedboolWhether the state is mixed.

Returns: The new state.

  • RaptorStepRule: Step size and range for a draggable Properties number field.