Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: play_edu on November 06, 2014, 12:31:46 AM

Title: How To Set Anchors At Runtime?
Post by: play_edu on November 06, 2014, 12:31:46 AM
Hi,

How To Set UI Sprite or  Widget(UI Rect) Anchors At Run time ?  Like Set Anchors (None),Set Anchors (Unified) or Set Anchors (Advanced). I can't Access This Properties.

Best Wishes,
Play_edu
Title: Re: How To Set Anchors At Runtime?
Post by: ArenMook on November 06, 2014, 02:16:35 AM
UIRect.SetAnchor, or manually set each -- uiRect.leftAnchor.Set, etc.

"Unified" simply means all 4 anchors (left, right, top, bottom) use the same target.
Title: Re: How To Set Anchors At Runtime?
Post by: play_edu on November 07, 2014, 11:57:14 PM
Thanks for ans.

I have a sprite set anchor but i want make it null at runtime , like anchor type none.


best wishes,
play_edu
Title: Re: How To Set Anchors At Runtime?
Post by: ArenMook on November 09, 2014, 08:53:08 PM
So do just that. uiRect.SetAnchor(null), or individually -- uiRect.leftAnchor.target = null;