Author Topic: [Solved] UIWidget size not according to game view size in preview  (Read 1832 times)

cmwcmw

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
I am using the UIWidget to set my UI size to "full screen" with the anchor settings.
As you can see from the picture I set the four margins to be zero but however i see nothing in the Game View because the size on the UIWidget is 2*3172.
But when I play the scene, the size is fine, UI is there.

Anyone know how to fix this? It is troublesome that I cant preview the UI  :(
Thanks



[Solved] There should be only 1 camera to draw the NGUI layer
« Last Edit: October 22, 2014, 03:56:14 AM by cmwcmw »

Pikol

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: UIWidget size not according to game view size in preview
« Reply #1 on: October 22, 2014, 03:49:51 AM »
I think you should set scaling type of your UIRoot as Constrained and mark Fit for Content Width and Content Height.

cmwcmw

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: UIWidget size not according to game view size in preview
« Reply #2 on: October 22, 2014, 03:55:11 AM »
I finally found the reason.
I didn't mask out the NGUI layer in my Main Camera. I should have only the UICam to draw the UI.

Thanks anyway ;)