Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


HandlePrefixLabel(Rect, Rect, GUIContent, int, GUIStyle)

Makes a label for some control.
Read time 1 minuteLast updated 5 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor
public static void HandlePrefixLabel(Rect totalPosition, Rect labelPosition, GUIContent label, int id, GUIStyle style)

Parameters

totalPosition

Rectangle on the screen to use in total for both the label and the control.

labelPosition

Rectangle on the screen to use for the label.

Label to show for the control.

id

The unique ID of the control. If none specified, the ID of the following control is used.

Optional GUIStyle to use for the label.

Remarks

HandlePrefixLabel is like PrefixLabel but allows custom control over the label position by supplying its Rect explicitly. PrefixLabel or HandlePrefixLabel should be used when creating a control with a connected label. It ensures that when the label is clicked, the control will get keyboard focus. For this reason it is important that the same ID is supplied to PrefixLabel or HandlePrefixLabel as to the control itself. It is also possible to not supply a Control ID, in which case the one from the immediately following control is automatically used.