Timeline for How to make a gui button follow a path after a touch?
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 7, 2013 at 13:55 | comment | added | Max | Wait, im not totally sure to have understand what you want to do. The curve that your gui's element must follow is static or it depends from the user input? If it is static you can give a bunch of point and make the gui following it (must be pretty clear with the script exemple in UItoolkit). If you need to track the user's input you should use an Update method where you track the Touch.position and than moving the gui's element according to it. | |
Mar 7, 2013 at 9:54 | comment | added | Paul | Thanks, I have just found out that UIContinuousButton contains a onTouchIsDown "event" linked with the onTouchMoved( Touch touch, Vector2 touchPos ) function (github.com/prime31/UIToolkit/blob/master/Assets/Plugins/…), would you know how to use the "touchPos" parameter? It seems that we have to use the "event", but the second parameter of this function seems to be the one I need, to make the image follow the touch position of the finger. Any idea? | |
Mar 7, 2013 at 9:03 | comment | added | Max | First of all, the solution of Heisenbug is surely correct but it take surely a bit of time for the implementation. Another possible solution could be (it depends by what you plaining to do) using a simple Lerp function and give more points for following the curve that you want. For doing this you will not need any other implementation, but it will need some attention in giving that points. | |
Mar 6, 2013 at 21:59 | comment | added | Paul | Thanks, yes I am using it, but with a curve, I did not find any function in UIToolkit (UISlider, or such) | |
Mar 6, 2013 at 9:35 | history | answered | Max | CC BY-SA 3.0 |