using UnityEngine;
using System.Collections;
public class LabelStretcher : MonoBehaviour {
void Start () {
UIRoot root = NGUITools.FindInParents<UIRoot>(gameObject);
float scale = (float)root.manualHeight / Screen.height;
UIAnchor anchor = GetComponent<UIAnchor>();
float offsetX = anchor.relativeOffset.x;
float widthPercentage = 1f - offsetX*2f; // margin on left/right.
UILabel label = GetComponent<UILabel>();
label.lineWidth = (int)(scale * Screen.width * widthPercentage);
}
}