Author Topic: Keep draggable windows visible  (Read 1952 times)

Codewalker

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 21
    • View Profile
Keep draggable windows visible
« on: September 30, 2013, 02:30:23 PM »
I created an interface where I have several "windows" (panels with widgets) that are draggable (just like in one of the NGUI-Demos). However, the user can drag the window almost out of sight. I'd like to limit the dragging to keep the complete window with it's full extents inside of the screen (and to force move windows that are out of these bounds back into the screen).

Does anyone have a clue or even a solution how to solve this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Keep draggable windows visible
« Reply #1 on: September 30, 2013, 08:25:50 PM »
Write code for it that detects window's dimensions leaving the screen. NGUIMath.Calculate series of functions may come in handy.