Author Topic: Aspect ratio / Portrait & Landscape  (Read 2152 times)

JSorrentino

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
Aspect ratio / Portrait & Landscape
« on: December 05, 2013, 04:24:55 PM »
Aaron,

    I have my UI originally designed at 1024 (600 min, 1280 max 1024 manual height).  All is well in portrait mode, which the game was originally developed to support only.

    Since then this has changed to allow orientation switches to all.  No issues in portrait, but when the device is put in landscape mode, the change scales down the UI.  I know this is proper and intentional, but this it not what i want.

    Is there an easy way to tell NGUI to keep the same aspect ratio that portrait uses, even if in landscape?

    My reasoning is that I will have 2 different menus - and if landscape is detected, ill use the landscape menu which should be sized the same, just I'll have it laid out different.

    Side note, using FixedSize for all the UIRoots.  Which is fine, again - I just need to override the default scaling to keep the portrait scale even if in landscape.

If this makes sense, thanks!

JS
« Last Edit: December 05, 2013, 04:41:46 PM by JSorrentino »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Aspect ratio / Portrait & Landscape
« Reply #1 on: December 06, 2013, 04:15:12 AM »
If you're just using one anchor point (center), then nothing will move when the aspect ratio changes -- which seems to be what you want. Using multiple anchor points is what makes it possible for elements to stick to sides and corners of the screen.

JSorrentino

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
Re: Aspect ratio / Portrait & Landscape
« Reply #2 on: December 06, 2013, 10:34:29 AM »
No, anchors are not the issue at all.  It's re-sizing sprites ( for instance, a back button is about 2/3 the size as portrait ) that are using simple anchors based off anchor points.

Maybe I'm just looking at this wrong, which could very well be the case.  I assumed that the scale was based off orientation in some way ( have not dug into that part of NGUI code much to research it, honestly was being lazy ).

Thanks, again.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Aspect ratio / Portrait & Landscape
« Reply #3 on: December 06, 2013, 02:01:12 PM »
Only screen height affects it.