Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Codewalker on September 30, 2013, 02:30:23 PM

Title: Keep draggable windows visible
Post by: Codewalker 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?
Title: Re: Keep draggable windows visible
Post by: ArenMook 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.