Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: didier on January 10, 2014, 03:28:20 PM
-
Hi
i have a clipped panel containing a scrollview that contains a grid and some items (sprites with colliders attached on them).
I attached the UIDragScrollView to those item (=sprite/colliders). All seems ok.
But i woul like the sprite to adapt to the screen size. So i used anchors (i use them for other widgets and its ok).
UNfortunatly i cannot seem to be able to make it work. I tried to add the anchors to either the panel, the scrollview or the items. I couldnt make them resized horizontally and vertically). Ideally the entire scrollview shall adapt to the screen size.
Is it possible to do such thing? How ? thanks
-
Adapt in what way? If you want it to cover a larger portion of the screen, then use the drag & drop example as your starting point. I have panels there that get anchored to the screen, and as you change the size of the screen, the scroll views shrink or grow accordingly.
-
Adapt in the "autoscale" way. Keep my widgets size the same proportion of the screen size, whatever the resolution is.
But in fact it works like a charm: i forgot to the change the scaling type of UIRoot to FixedSize. I changed it as and now my GUI looks (almost) perfect :)
-
@ArenMook
I'm having the same issue. Looking over your example I see some great ideas but mainly you make this work using the deprecated UIAnchor class. Is this the recommended way to do this?
-
No, you should not be using UIAnchor anymore. Thanks for bringing it to my attention. You should remove UIAnchors altogether.