Author Topic: Get the screen size in local ngui space?  (Read 2414 times)

col000r

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 3
  • Posts: 43
  • Mighty Emperor of Planet "Home Office"
    • View Profile
    • BLACKISH
Get the screen size in local ngui space?
« on: September 10, 2014, 04:54:11 AM »
Is there an easy way to get the screen space in local dimensions?

What I'm trying to say is this: I have a widget and I want it to fill 80% of the width and 80% of the height of the screen, yet I can't simply use Screen.width/height. Is there a simple way to get the width/height I'd have to enter on a specific widget to make it fill the entire screen?
Games: BLACKISH | Blog | Assets

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Get the screen size in local ngui space?
« Reply #1 on: September 10, 2014, 11:13:30 AM »
  1. var screenHeight = UIRoot.GetPixelSizeAdjustment(gameObject)  * Screen.height;
  2. var screenWidth = UIRoot.GetPixelSizeAdjustment(gameObject)  * Screen.width;
  3.