After reading several topics in this forum about this, I am figuring out it's not too easy to get the DESIGN width of UI Root.
I mean:
Normally on any widget you just make:
gameObject.GetComponent<UIWidget>().width
and you get the width. But it seems to me this doesn't work for UIRoot. If you make
GameObject("UI Root").GetComponent<UIPanel>().width
you don't get the design width but the screen width (at least width the lastest NGUI version).
I have to multiply this value by
GameObject.Find("UI Root").GetComponent<UIRoot>().manualHeight / Screen.height
So my doubt is:
Is this way to do it? Isn't there any value on UIRoot or UIPanel for the design width?