Author Topic: Scaling style "Closest multiple of two"  (Read 5007 times)

tnbao91original

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 41
    • View Profile
Scaling style "Closest multiple of two"
« on: July 07, 2014, 05:57:15 AM »
Hi guys, i have a question about scaling style. So NGUI have scaling style like "Closest multiple of two" of TK2D ? When i change scene from native scene 1920x1280 to 1024x768 if i use ngui with scaling style fixedsizeonmobile, it only scale base height but if i remove UI Root, UI Camera and use tk2d camera with overrider so it scale base width and height

You can see results

Totally NGUI 3.6.7


http://postimg.org/image/ixyne1tg3/

Totally NGUI but remove UI Root and UI Camera, use only TK2DCamera 2D Tookit 2.4.0


http://postimg.org/image/ni0ftz0bf/
« Last Edit: July 07, 2014, 06:47:34 AM by tnbao91original »

tnbao91original

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 41
    • View Profile
Re: Scaling style "Closest multiple of two"
« Reply #1 on: July 07, 2014, 09:28:03 PM »
Anyone know how to scale base width and height ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scaling style "Closest multiple of two"
« Reply #2 on: July 08, 2014, 11:20:14 AM »
I'm not sure what you mean here. What does "Closest multiple of two" do exactly? Fixed size UIRoot simply makes NGUI use virtual pixels instead of actual pixels, so if the screen height changes, your UI will remain proportional instead. So if something was 20% of the screen's height, it will remain exactly that size as you resize the screen. I'm also not sure what you mean by scaling base width and height. What base width and height? The width is determined by your aspect ratio. Screen's height multiplied by the screen's aspect ratio is your width. You can't skew your UI. You can never make a square into a rectangle by changing the width of your screen. It will always remain a square.

Unless you anchor that widget, of course.

tnbao91original

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 41
    • View Profile
Re: Scaling style "Closest multiple of two"
« Reply #3 on: July 09, 2014, 05:31:22 AM »
In overall, do we support a flexible scaling mode based on the resolution or ratio of the device ?

For example, I want to set ipad with "FixVisible" mode, set all 16:9 device with other XYZ mode and "FixHigh" for unknown devices... I see on TK2D they have more than 7 modes and it's pretty good to bring the "pixel perfect" quality to as many devices as possible.

At this time, we have to remove UIroot and use the Camera code from TK2D but it makes some awesome NGUI features stop working correctly.

tnbao91original

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 41
    • View Profile
Re: Scaling style "Closest multiple of two"
« Reply #4 on: July 13, 2014, 08:28:41 AM »
Anyone ? :(

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scaling style "Closest multiple of two"
« Reply #5 on: July 13, 2014, 05:30:30 PM »
You are using concepts from a kit I am not familiar with, and I can't help you there. As I said, UIRoot simply scales itself based on the size of the screen if you leave it in PixelPerfect mode. If you set it to Fixed Size, then it won't scale. It will remain the same size. So regardless of the screen size, your UI will look the same size proportionally. I can't explain it any better than it's explained on the documentation page for the UIRoot.