Author Topic: Question on "Jittering Edges" when Moving Sprites (Anti-Aliasing Issue?)  (Read 2261 times)

blitzer

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 52
    • View Profile
Hello everyone, I'm working on making a "looping scroll" background that scrolls and eventually loops back to the first image, which is straight forward enough. However, I'm coming across a problem where, when moving the widgets, the edges of the widgets shake/jitter a bit as they move across the screen.

I made a quick video that hopefully shows this clearly enough:
https://www.youtube.com/watch?v=CanCkPDuxJY

Obviously, the rotated sprite has aliasing issues, and I'm guessing that even the "aligned" sprites issue is still from aliasing? I guess I've just never noticed it happen on "aligned" textures before, just looking for someone to confirm or deny that conclusion.

Any ideas appreciated, thank you for reading.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Question on "Jittering Edges" when Moving Sprites (Anti-Aliasing Issue?)
« Reply #1 on: February 24, 2015, 11:43:32 AM »
What version of NGUI are you using? When scrolling stuff you should ensure that you're using whole integer values for positions, otherwise pixels will fall in-between of actual screen pixels, leading to undesired results. Do actual tween lerping in floats, but when setting the transform position use rounded values.

blitzer

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 52
    • View Profile
Re: Question on "Jittering Edges" when Moving Sprites (Anti-Aliasing Issue?)
« Reply #2 on: February 24, 2015, 11:59:33 PM »
What version of NGUI are you using?
-> 3.7.4

Basically what I'm doing is calling UIScrollView.MoveRelative(my offset), so substituting a mouse drag with code. I figured that was the "safest" way of doing it since it uses methods NGUI already implemented.

My hierarchy for doing this:
Panel[UIPanel, UIScrolView]
-WrappedObjectsParent[UIWrapContent]
--Sprite1
--2
--etc.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Question on "Jittering Edges" when Moving Sprites (Anti-Aliasing Issue?)
« Reply #3 on: February 27, 2015, 04:35:17 AM »
Please update. 374 is very old. If this is the issue I'm thinking of, it was fixed many months ago.