Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: DirtyHippy on September 01, 2012, 09:05:50 PM

Title: Getting screen rect for NGui control
Post by: DirtyHippy on September 01, 2012, 09:05:50 PM
I have been developing a pretty complex gui for a while now, and I've been using a function to get the screen rect (i.e. left, top, right, bottom) that I have written but it isn't perfect and it is driving me nuts.  Is there a simple way to do this?
Title: Re: Getting screen rect for NGui control
Post by: ArenMook on September 01, 2012, 10:51:20 PM
You mean NGUIMath.Calculate series of functions? They calculate the dimensions of a group of widgets, not screen though. Screen would be just Screen.width and Screen.height.
Title: Re: Getting screen rect for NGui control
Post by: DirtyHippy on September 02, 2012, 10:25:00 AM
No, the bounds of the control in screen space.  I.e. left, top, right, bottom.  The Calculate functions do not do this.
Title: Re: Getting screen rect for NGui control
Post by: ArenMook on September 02, 2012, 04:05:35 PM
The Calculate function does exactly that, actually. NGUIMath.CalculateRelativeWidgetBounds.