Author Topic: Jitter Bug Blues  (Read 1629 times)

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Jitter Bug Blues
« 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Jitter Bug Blues
« Reply #1 on: March 11, 2014, 06:17:31 PM »
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.

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: Jitter Bug Blues
« Reply #2 on: March 12, 2014, 12:26:37 AM »
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?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Jitter Bug Blues
« Reply #3 on: March 12, 2014, 09:49:58 PM »
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)?