Author Topic: How to keep a panel from dragging offscreen?  (Read 1405 times)

heliosprime

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
How to keep a panel from dragging offscreen?
« on: April 05, 2013, 02:30:11 AM »
I have a panel that has been made draggable.   How do I keep the panel from being allowed to be dragged offscreen?  I'd like to enforce the panel to always have at least X pixels onscreen.  Ideally, if it is dragged too far, I'd like to have it spring back on screen within the set bounds.  I can't seem to figure out where in the UIDraggablePanel script to check the bounds.

Thanks in advance for any hints.

dlewis

  • Guest
Re: How to keep a panel from dragging offscreen?
« Reply #1 on: April 05, 2013, 03:36:37 AM »
There is a bool on the inspector which is 'keep inside bounds' or something. If that is ticked then the contents will stay within the clipping area of the panel (must be clipped)