Author Topic: How to keep aspect ratio when change to fullscreen  (Read 2906 times)

xushunwang

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
How to keep aspect ratio when change to fullscreen
« on: June 09, 2014, 03:28:05 AM »
I create a new scene and click NGUI->Create->UITexture to add a texture.
Change UIRoot's scaling style to FixedSize and Manual Height to 384
The texture is 512*384 , the ratio is 4:3.


When i build and run it in window mode , it looks well.
But if I run it in fullscreen , I find the texture is stretch to fill the screen . the aspect ratio is not 4:3 any more, it change to 16:9!

I want it stretch based on height and keep aspect ratio like this picture :


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to keep aspect ratio when change to fullscreen
« Reply #1 on: June 09, 2014, 03:37:21 AM »
All widgets have an "aspect ratio" setting that you can set. Anchor only top and bottom sides, leaving left and right free. Choose the aspect ratio based on height.