unity3d 设置Text的文字内容和位置

 tempQie2.transform.SetParent(GameObject.Find("Canvas").transform);

            Text text = tempQie2.GetComponent();
            text.text = contentStr;
            text.fontSize = fontSize;

            RectTransform rt = tempQie2.GetComponent();            
            rt.sizeDelta = new Vector2(200, 300);
            rt.transform.position = new Vector2(10, 10);
            rt.transform.Rotate(new Vector3(0, 0, 45));

你可能感兴趣的:(unity3d)