Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Sephiroth73003 on July 31, 2012, 05:07:51 PM

Title: Scaling to screen size?
Post by: Sephiroth73003 on July 31, 2012, 05:07:51 PM
So my current project UI is coming along fine, but I have the camera at the current target resolution and am trying specify all sizes of objects as a function of screen size for when I begin work on different resolutions.

Thing is when I call Screen.width I am only getting the current game screen width in the editor so it doesn't lineup with coordinate system I am using for the camera. (IE camera is set to 1280x720 through UIRoot but the Game editor is some other smaller 16:9 system). I know NGUI calculates relative sizes but I can't seem to directly set them myself (read only). How do I get access to the current camera bounds since pixelHeight/pixelWidth also just return the Screen sizes in the editor.
Title: Re: Scaling to screen size?
Post by: ArenMook on July 31, 2012, 10:24:46 PM
Uncheck the "automatic" checkbox on UIRoot, and then you will be able to set the size manually.
Title: Re: Scaling to screen size?
Post by: JRoch on August 01, 2012, 12:58:30 AM
Also, take a look at the pixelWidth and pixelHeight properties of the Camera object for your main camera.  ScreenWidth and ScreenHeight aren't always relevant if your app is running in windowed mode.