Author Topic: Question about scale in UIDraggableCamera  (Read 3753 times)

imperso

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 16
    • View Profile
Question about scale in UIDraggableCamera
« on: April 08, 2015, 12:35:22 PM »
Hi, ArenMook

I have an orthographic camera with UIDraggableCamera component with scale X0 Y1, so that I can scroll it only vertically.
Everything is working fine except this.
At some moment I have a sprite appearing via TweenScale shrinking from very large to its native size (this effect only lasts for 0.7 sec).
This sprite is a child of the panel which I use as a UIDraggableCamera drag-limiting root (although the RootForBounds colliders are set to a very large size - about 10000 x 10000).

At start this sprite becomes so large that it's partly off screen.
And if at this moment I drag the DraggableCamera, it overrides the X restriction and jumps to the corner of some recalculated bounds.
I tried to make the RootForBounds colliders even larger and set panel constraints but that doesn't affect anything.
What is the best I can do to block this behavior?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Question about scale in UIDraggableCamera
« Reply #1 on: April 09, 2015, 03:44:28 PM »
From what I remember draggable camera is very limited. I created it before adding the clipped panel feature as a way to do scroll views. However due to how Unity works it's not possible to have camera's rect exceed the screen size, which meant the region of the "window" must always be 100% on screen. Why are you using this ancient script instead of sticking to clipped panels / scroll views?

imperso

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: Question about scale in UIDraggableCamera
« Reply #2 on: April 09, 2015, 04:49:24 PM »
The previous developer implemented this solution. I didn't know it's deprecated.
Anyway, thanks.