Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: artfabrique on February 03, 2014, 12:01:04 PM
-
Hi there!
Is there any way to have my UILabel stretched horizontally (by setting left and right anchors) and have overflow "Resize Height"?
I've tried to use old UIAnchor an UIStretch but it doesn't suits me:
I simply have a table with widgets in each cell and i UILabel inside each widget centered vertically. At some point of time i resize all widgets and call UITable.Reposition() BUT! all UILabels do not update their positions after it's container height changed (old UIAnchor :( )
That's why i decided to switch to new Anchor system and bought a fresh version of NGUI :P
And i just don't get how to make it work with UILabels+new Achors+ResiseHeight.
Can somebody please help?
P.S.
Also i've noticed that the new Anchor system is very powerful, BUT!! PLEASEPLEASE! make 1 small checkbox: "forbid stretching". And for example after i check it — 2 out of 4 Anchors become disabled (based on which pivot positioning i've previously selected). It will ease up the UI creation process very much because now it's simply impossible to enter coordinates by hand because you have to modify all 4 numbers OR every time switch to Advanced and point 2 of 4 Anchors to widget itself,where you have to input widget dimensions again. This take so much time and cost of error is very high in terms of production timeline.
-
If you want the height to be resized but width to be anchored, then use Advanced anchor type and only set the left and right anchors. Leave the label's overflow at "resize height". You don't need to have all 4 set.
Re: Forbid stretching -- stretching of what? If you want to keep a specific aspect ratio, then do just that -- set an aspect ratio on your widget, and anchor only certain sides.
-
If you want the height to be resized but width to be anchored, then use Advanced anchor type and only set the left and right anchors. Leave the label's overflow at "resize height". You don't need to have all 4 set.
ITS WORKING!!! Thank you. I think this was the pretty basic question with this new Anchor system but solution not obvious )