Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Dean on April 18, 2015, 10:08:23 AM

Title: Set the anchors type
Post by: Dean on April 18, 2015, 10:08:23 AM
Hellow, help me please with this problem:
How can I set Anchors type to "Unified" by code?
And also in the box "Right" put "Target's left" or in the "Bottom" -> "Target's top" by code to?

(http://screenit.ru/d1/img_75090130713.png)

Upd. I found a solution for the 1st quiestion:
SetAnchor(GameObject.Find("Camera"), 0, 0, 0, 0);

Upd2. Found and for the 2nd:
GetComponent<UIWidget>().leftAnchor.Set(0, int offset); - Target's left;
GetComponent<UIWidget>().leftAnchor.Set(1, int offset); - Target's right

the same for top/bot