Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Seroster on September 26, 2014, 03:39:02 PM
-
Hi all,
This is hurting my head a bit and maybe someone has dealt with this issue before.
I'm working on the mobile phone layout for an app which is supposed to be mostly in portrait but a few parts are in landscape. The app was originally built (to avoid load times, I guess) as one gigantic scene.
What is the best general approach to take here? For instance, one of these scenes has a couple of scroll views in it (one horizontal, and one vertical). If I set the rotation on a scroll view to 90 or 270, should placement and input work properly? My current observation is that it doesn't seem to work, BUT there might be interference from some of the scripts being used. Or should I anticipate that I'll want to change, for instance, a vertical scroll view to a horizontal one, with elements in the scroll view whose *contents* are rotated?
-
Yes, it should work -- you can flip the entire scroll view upside down by clicking a button in the 7th example that comes with NGUI.
...but why are you rotating the scroll view? Your UI shouldn't rotate. The screen rotates, which merely changes the width and height values. The UI should remain as it was. Assuming you've made it modular/anchored and set your UIRoot settings properly, everything will snap to place.
-
Hey, thank you for the reply. :) I'll try to clarify.
I've got effectively some parts of the UI which should ONLY appear as portrait and others which should ONLY be landscape.
If I just build the app in Unity and enable both portrait and landscape, I assume everything will rotate, and yes, if I've anchored everything properly, it should all reposition, and rescale correctly. And that would be fine if those were the specifications I'd been given - but they're not. (And also to clarify, in another post I referred to a hobby game... I'm working on the side on a freeware game, but THIS question is for a professional environment in which I'm modifying an existing app which uses NGUI)
So my thought was, build only enabling portrait, and for the parts that are supposed to be landscape, "fake it".
I'm not really sure that just rotating the elements is going to work. I tried doing that to one scroll view and there was some very strange behavior (elements animating off diagonally?). It might be simplest and clearest to build these parts of the UI by, for instance, changing a horizontal scroll view to a vertical one, with cells whose width and height I swap, and then just rotate the sprites inside the cells.