NGUI "Joystick" type of slider?

I would have posted it within the NGUI forum, but my account is still waiting for approval from the Admin.

Is it possible to create a “joystick” type of slider, where it combines a horizontal and vertical slider in one, allowing limits? In the example I would like to be able to move the white dot around within the gray area, thus modifying 2 float variables for my morph.

Thanks!

1214662--49558--$slider.jpg

Or can you do this another way?

within NGUI - i´m not sure… but you can add a Box with NGUI, and a Dot (+ UIDragObject).

And now check the distance of the Dot´s center, to the origin of the box. Like:

Dot is on 22,56 inside the box, the boxs origin is on the upper left.
so
Slider X would have a percentage of ((22100)/box.size_x), and Slider Y of ((56100)/box.size_y)

I think this way you could create your own Box Sliders :slight_smile:

Easy-peasy with eDriven.

Hi, I think a way to do this would be using the dragobject script on a joystick sprite. You will have to then check distance to original position like Chaosgod_Espér says and then restric its movemnt in the dragobject script. A way to restric is already present there with bound clipping