Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

EditorGUIUtility.AddCursorRect

static function AddCursorRect(position: Rect, mouse: MouseCursor): void;
static void AddCursorRect(Rect position, MouseCursor mouse);
static def AddCursorRect(position as Rect, mouse as MouseCursor) as void
static function AddCursorRect(position: Rect, mouse: MouseCursor, controlID: int): void;
static void AddCursorRect(Rect position, MouseCursor mouse, int controlID);
static def AddCursorRect(position as Rect, mouse as MouseCursor, controlID as int) as void

Parameters

positionThe rectangle the control should be shown within.
mouseThe mouse cursor to use.
controlIDID of a target control.

Description

Add a custom mouse pointer to a control.

	function OnGUI()
	{
		// show the "Link" cursor when the mouse is howering over this rectangle.
		EditorGUIUtility.AddCursorRect (Rect(10,10,100,100), MouseCursor.Link);		
	}