Author Topic: How to make sure the UI remains full screen ?  (Read 5236 times)

VapapeurTeam

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
How to make sure the UI remains full screen ?
« on: February 21, 2013, 05:50:01 AM »
Hello,

I've created a very simple UI ( a tiled sprite and a button ), with all the default nodes above (UIRoot, Anchor, Camera, Panel). I can't seem to find a way to make sure my UI will always completely fill the screen. Is there a specific script I must attach somewhere to ensure that ?

Thanks.

VapapeurTeam

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 16
    • View Profile
Re: How to make sure the UI remains full screen ?
« Reply #1 on: February 21, 2013, 02:45:59 PM »
Bump. Any suggestions ?

Thanks in advance.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: How to make sure the UI remains full screen ?
« Reply #2 on: February 21, 2013, 03:07:34 PM »
Depends on what you want to fill the screen. If it's a single widget, like a background, look at UIStretch.cs.

DoctorWhy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: How to make sure the UI remains full screen ?
« Reply #3 on: February 21, 2013, 07:23:15 PM »
I don't know if NGUI has something specific to help with this, but I just made my own script that took all the pieces of the menu, and placed them correctly no matter the screen resolution. Just have a script on the Camera that runs on Start that places everything based on the Screen.width and Screen.height.  It is easier if you make the anchor based on the bottom left corner.