Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: wallabie on March 10, 2014, 11:06:30 PM
-
Here's my first attempt at creating a resizable thumb control. I added a thumbLeft and thumbRt as children of the main thumb. Then I added a DragResize to both of the children. When dragging the thumbRt constantly does a Jitter Bug dance. I tried changing various combinations of pivots but still the same jittering. The thumbLeft stays perfect.
Video: https://dl.dropboxusercontent.com/u/48378123/JitterBugBlues.mp4
Another question: Is it possible to change the pivot at run time, for example, if the user clicks on thumbLeft or thumbRt, I would like to change the pivot of the parent's Thumb.
-
I don't know what you have them anchored to, but the jitter is likely caused by floating point rounding resulting from having a centered pivot and dimensions that are not dividable by two.
Yes you can change the pivot at run time. UIWidget.pivot.
-
The 2 extra left and right thumb sprites are simply children of the Thumb sprite.
As you can see, the left Thumb works, but the right one doesn't. Should I use some sort of anchor?
-
If they are children, and they are not anchored, then they will always move with the parent and have no reason to jitter. Can you post a pic of inspector with the offending sprite selected (one that jitters)?