Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Decco on May 14, 2014, 12:05:00 PM

Title: FixedSize suggestion
Post by: Decco on May 14, 2014, 12:05:00 PM
Hi,

I have a suggestion/request :
In UIRoot, when set to FixedSize, would it be possible to have an option to set manual width and/or an option to fit/fill the screen while keeping the original aspect ratio ?

Thank you !
Decco
Title: Re: FixedSize suggestion
Post by: Nicki on May 14, 2014, 12:50:43 PM
It's easy to add this as a different component you put next to UIRoot.

You just have to fill in the original aspect, since there's not really any "original" when you think of the UIRoot.
Title: Re: FixedSize suggestion
Post by: Decco on May 15, 2014, 04:08:34 AM
Yes, but it would be nice if it is integrated in NGUI.

There is an orginal aspect. For exemple if you worked on a background at 16/9 aspect and you would like to fit it in a 4/3 screen... So if you can enter your original resolution and set it to automaticallly fit or fill any other resolution/aspect, it would be perfect.
Title: Re: FixedSize suggestion
Post by: ArenMook on May 15, 2014, 12:02:12 PM
UIRoot has no width. Just height. Likewise it has no aspect ratio because it has no width. You can make it shrink itself based on width using the checkbox on the component, but that's about it.

Sprite within a fixed size root UI that had an aspect ratio to 16:9 and was filling the entire screen will have its sides cut off on a 4:3 aspect ratio screen. If you want the sprite to resize itself, anchor it.
Title: Re: FixedSize suggestion
Post by: Decco on May 19, 2014, 09:46:30 AM
Hi ArenMook,

Thank you for your reply.

Quote
If you want the sprite to resize itself, anchor it.

I have tested with the Anchor of course, but it does not keep the apect ratio and it does not scale the whole ui.

Quote
Sprite within a fixed size root UI that had an aspect ratio to 16:9 and was filling the entire screen will have its sides cut off on a 4:3 aspect ratio screen.

That's the problem ! It would like be able to set to FIT in the screen. so the sides are not cut off, but instead have black bar on top and bottom, like a movie.

Quote
You can make it shrink itself based on width using the checkbox on the component, but that's about it.

It works only for portrait mode. Of course i'm working in landscape mode.

Quote
UIRoot has no width. Just height. Likewise it has no aspect ratio because it has no width.

Why is it based on height and not width ? or both ?
Title: Re: FixedSize suggestion
Post by: ArenMook on May 19, 2014, 12:22:00 PM
All widgets have an "aspect ratio" field you can set. If you set it to a fixed aspect ratio and anchor only two sides, then the other two will be set using the aspect ratio. For example, try giving a sprite an aspect ratio of 1.7 and anchoring only top and bottom sides, leaving left and right free.