Handles.Slider2D Manual     Reference     Scripting  
Scripting > Editor Classes > Handles
Handles.Slider2D

static function Slider2D (handlePos : Vector3, handleDir : Vector3, slideDir1 : Vector3, slideDir2 : Vector3, handleSize : float, drawFunc : DrawCapFunction, snap : float, drawHelper : boolean = false) : Vector3

Parameters

NameDescription
handlePos the position of the current point.
handleDir the direction of the handle, only used for rendering of the handle
slideDir1 the first direction of the sliding.
slideDir2 the second direction of the sliding.
handleSize the size of the handle - HandleUtility.GetHandleSize (position);
drawFunc the function to call for doing the actual drawing - by default, it's Handles.ArrowCap, but any function that has the same signature can be used.
snap use snapping (uses SnapSettings.scale)
drawHelper render a rectangle around the handle when dragging

Returns

Vector3 - the new handle position Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-sized handles.

Description

Slide a handle in a 2D plane

This will draw a draggable handle on the screen. The handle is constrained to sliding on a plane.