Author Topic: draggable panel work once but not twice  (Read 5339 times)

laurentl

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 188
    • View Profile
    • McDROID
draggable panel work once but not twice
« on: August 06, 2013, 10:43:37 PM »
very weird glitch here
anyone encountered that?
https://www.youtube.com/watch?v=eQ3EJgvHAC8

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: draggable panel work once but not twice
« Reply #1 on: August 07, 2013, 05:05:33 AM »
Try enabling debugging on the UICamera to see what the mouse is hovering over.

laurentl

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 188
    • View Profile
    • McDROID
Re: draggable panel work once but not twice
« Reply #2 on: August 07, 2013, 05:21:29 PM »
When I turn on debug in UICamera and turn on gizmos in the game view nothing gets highlighted.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: draggable panel work once but not twice
« Reply #3 on: August 08, 2013, 09:48:41 AM »
UICamera's debug is a run-time feature. Play the game. Hover mouse over something.

laurentl

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 188
    • View Profile
    • McDROID
Re: draggable panel work once but not twice
« Reply #4 on: August 13, 2013, 11:26:15 PM »
UICamera reset debug to false, probably as a safety measure

I see it displays the current ray hit, the draggable elements are getting hit but do not drag anymore after a few drags.
The colliders are active, so are UIDraggablePanel and UIDragPanelContent and... I just know what happened, DisableDragIfFits was on :)

So I turn it off but now I can drag the items out of the screen. How would I rubber band it when dragged out of frame?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: draggable panel work once but not twice
« Reply #5 on: August 15, 2013, 07:52:33 AM »
Disable dragging if fits will prevent dragging if the content is fully visible.

In that video not all the content is visible.

However one other thing I noticed: you have very weird scales. It's generally a bad idea to use scales other than (1, 1, 1) with NGUI (not including widgets). It's an even worse idea to use non-uniform scales like you do in there. As a rule of thumb, if you select the UIRoot, hit ALT+SHIFT+P and something changes visibly, then you should reconsider what you're doing.