A slider which supports both X and Y values within a box
1 Overview
3 Methods
4 Usage
6 See also
The Box Slider (like the Unity Slider controls), allows you to set a value using a handle within the RectTransform of the control. However, it supports both the X and Y axis within the area.

It allows you to set a minimum and maximum value for the axis as well as separate X and Y value selectors.
Like the Slider, it also includes an OnValueChanged event which updates as the handle is moved by the user.
The properties of the Box Slider control are as follows:
| Property | Description |
|---|---|
| Handle Rect | The Rect Transform of the child handle, position used to derive values for control |
| Min Value | The minimum value for the sliders |
| Max Value | The maximum value for the sliders |
| Whole Numbers | Only use whole numbers instead of floats |
| Value X | The X value of the slider |
| Value Y | The Y value of the slider |
| On Value Changed (event) | The Event fired when the handle within the box slider is changed |
| Method | Arguments | Description |
|---|---|---|
| Rebuild | CanvasUpdate executing | Invokes value-changed during editor layout updates |
| LayoutComplete | — | ICanvasElement lifecycle hook (no-op) |
| GraphicUpdateComplete | — | ICanvasElement lifecycle hook (no-op) |
| OnPointerDown | PointerEventData eventData | Starts dragging and optionally jumps to click position |
| OnDrag | PointerEventData eventData | Updates the X/Y values based on drag position |
| OnInitializePotentialDrag | PointerEventData eventData | Disables drag threshold for immediate response |
| SetXWithoutNotify | float x | Sets X value without firing OnValueChanged |
| SetYWithoutNotify | float y | Sets Y value without firing OnValueChanged |
Simply add the default BoxSlider to the scene using:
“GameObject -> UI -> Extensions -> Sliders -> Box Slider”
Alternatively, add the component to an existing GameObject using:
“Add Component -> UI -> Extensions -> Sliders -> BoxSlider”
Note: When adding via the Add Component menu, you will need to manually set the Handle reference.
Also, check out the ColorSlider which implements this control
Credit judah4
Sourced from - http://forum.unity3d.com/threads/color-picker.267043/