Class IconMappingDrawer
Provides static editor utility methods for rendering individual IconMapping entries
inside a ReorderableList, as used by InputIconSetEditor.
Inherited Members
Namespace: Scylla.Input.Editor
Assembly: ScyllaInput.Editor.dll
Syntax
public static class IconMappingDrawer
Remarks
Each entry consists of three fields sourced from the serialized
IconMapping struct:
BindingPath- the Unity Input System binding path string (e.g.,"<Gamepad>/buttonSouth").Icon- an optional UnityEngine.Sprite shown as a thumbnail preview.DisplayText- a short fallback label (e.g.,"A","Space") used when no sprite icon is available.
The full-height element layout places the sprite preview on the left and the three
text/object fields stacked on the right. The compact single-line layout is used for
collapsed or summarized views. Element height is calculated by
GetElementHeight() and must be returned from the list's
elementHeightCallback delegate.
An inline warning indicator ("!") is shown next to the binding-path field
when the path is empty.
Fields
DELETE_BUTTON_WIDTH
Reserved pixel width for the per-row delete button (not drawn by this class directly; available for callers that manage their own delete buttons alongside this drawer).
Declaration
public const float DELETE_BUTTON_WIDTH = 20
Field Value
| Type | Description |
|---|---|
| float |
FIELD_SPACING
Horizontal gap in pixels between the sprite preview and the text/object fields.
Declaration
public const float FIELD_SPACING = 4
Field Value
| Type | Description |
|---|---|
| float |
LABEL_WIDTH
Reserved label column width in pixels for display-name style fields within the mapping entry (not currently used in the main draw path; available for external callers).
Declaration
public const float LABEL_WIDTH = 50
Field Value
| Type | Description |
|---|---|
| float |
SPRITE_SIZE
Width and height in pixels of the square sprite thumbnail drawn on the left side of each full-height DrawElement(Rect, SerializedProperty, int, bool, bool) row.
Declaration
public const float SPRITE_SIZE = 48
Field Value
| Type | Description |
|---|---|
| float |
Methods
DrawCompact(Rect, SerializedProperty)
Draws a compact single-line read-only preview of an IconMapping entry, showing
a small sprite thumbnail scaled to fit the row height, the binding path in muted style,
and the display text in bold style.
Declaration
public static void DrawCompact(Rect rect, SerializedProperty element)
Parameters
| Type | Name | Description |
|---|---|---|
| Rect | rect | The bounding UnityEngine.Rect for the single-line row. The height determines the size of the inline sprite thumbnail. |
| SerializedProperty | element | The UnityEditor.SerializedProperty for the |
DrawElement(Rect, SerializedProperty, int, bool, bool)
Draws a full-height IconMapping element inside a ReorderableList,
rendering a sprite thumbnail on the left and - stacked vertically on the right - an
editable binding-path field, an editable display-text field, and a sprite object field.
Declaration
public static void DrawElement(Rect rect, SerializedProperty element, int index, bool isActive, bool isFocused)
Parameters
| Type | Name | Description |
|---|---|---|
| Rect | rect | The bounding UnityEngine.Rect provided by the |
| SerializedProperty | element | The UnityEditor.SerializedProperty for the |
| int | index | The zero-based index of this element in the list (reserved for future use). |
| bool | isActive | true when this element is selected in the list (reserved for future selection-highlight rendering). |
| bool | isFocused | true when this element has keyboard focus (reserved for future focus-highlight rendering). |
GetElementHeight()
Returns the required element height in pixels for a full-height IconMapping row,
accounting for three stacked fields (binding path, display text, and icon object field)
and ensuring the row is at least as tall as the SPRITE_SIZE thumbnail.
Declaration
public static float GetElementHeight()
Returns
| Type | Description |
|---|---|
| float | The greater of the sprite thumbnail height and the combined three-field column height, plus Scylla.Input.Editor.IconMappingDrawer.ELEMENT_PADDING for vertical breathing room. |