Author Topic: Getting screen rect for NGui control  (Read 3361 times)

DirtyHippy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Getting screen rect for NGui control
« 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?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Getting screen rect for NGui control
« Reply #1 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.

DirtyHippy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Getting screen rect for NGui control
« Reply #2 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Getting screen rect for NGui control
« Reply #3 on: September 02, 2012, 04:05:35 PM »
The Calculate function does exactly that, actually. NGUIMath.CalculateRelativeWidgetBounds.