Author Topic: Buttons not working properly if 2D camera is zoomed then panned  (Read 2881 times)

technoir

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 1
  • Posts: 27
    • View Profile
Hi,

I have a pinch-zoom setup where I can zoom and pan into and across a sprite which has buttons on it (using FingerGestures for the pinch-zoom and pan). For some reason, when I zoom and then pan (for example, to the right) the button colliders on the buttons appear to also move. In the scene view they look like they're in the same place but in game view, the buttons react with a colour change to a mouse-over/click if I move the cursor next to them.

Any ideas on what could be causing this?
Thanks
« Last Edit: July 31, 2014, 05:35:40 AM by technoir »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Buttons not working properly if 2D camera is zoomed then panned
« Reply #1 on: July 31, 2014, 11:27:14 AM »
How do you zoom, exactly? NGUI's behaviour was designed with camera ortho size of 1 in mind, so I hope you aren't changing that. That said, I see no reason why even doing that would change the colliders or cause them to not be aligned. Now if you had two widgets on the same game object, then yes, that would cause weird issues like that when you move something and its collider ends up in one place but the visible object ends up in another.