Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Sahkan on November 19, 2014, 06:29:33 AM

Title: How can i anchor a UIPanel ?
Post by: Sahkan on November 19, 2014, 06:29:33 AM
I'm using NGUI 3.7.1 ( And not allowed to update at the moment ).
When i want to anchor some object i add an Anchor to it's sprite, label etc... and if there is nothing there i'm adding a widget. The problem is, UIPanel's anchor doesn't have the same behavior like the normal anchors. So the question is, is it ok to put an extra UIWidget to apply the anchor on it? will it mess things up as far as the alpha and other properties goes ?
Title: Re: How can i anchor a UIPanel ?
Post by: ArenMook on November 19, 2014, 03:48:43 PM
UIAnchor is a legacy component. It shouldn't be used anymore. Stick to the built-in anchoring system.
Title: Re: How can i anchor a UIPanel ?
Post by: Sahkan on November 20, 2014, 02:06:14 AM
I was talking about the built in system.
I add a widget so i can use it's anchor.
But the anchor on the panel works differently.
Title: Re: How can i anchor a UIPanel ?
Post by: slumtrimpet on November 20, 2014, 12:04:23 PM
If you turn on soft-clipping on the panel it has the normal anchoring features doesn't it?  I'm kinda curious on the answer to this too, but my experience is that the panel by default is 'full screen' with no anchor settings needed or available but as soon as you turn on soft-clip you get the normal anchor options just like an object with a UIWidget.
Title: Re: How can i anchor a UIPanel ?
Post by: ArenMook on November 20, 2014, 08:54:19 PM
Panel must have some clipping type other than "none" for it to actually have a rectangle to work with, and by association -- anchoring functionality.

Otherwise a panel is just a boundless object that merely collects and draws widgets.
Title: Re: How can i anchor a UIPanel ?
Post by: Sahkan on November 23, 2014, 02:28:53 AM
Yes but i can't anchor the panel to an other panel, if i do so, it won't move with it, it will just change it's rec and there for will move it's anchored children but won't move the anchor position like it would in a normal widget.