Quantcast
Channel: Questions in topic: "dynamically"
Viewing all articles
Browse latest Browse all 152

Unity 2d Dynamic UI text not rendering on Canvas

$
0
0
Hi I am trying to add a dynamic text to canvas but it is not appearing on screen. please help. below is my code.

var text = this.gameObject.GetComponentInChildren ();
text.text = "abc";
Text t = gameObject.AddComponent<Text&gt();
t.text = "Testing"; t.rectTransform.position = new Vector2 (23, 23);//screenspace coordinates

Viewing all articles
Browse latest Browse all 152

Trending Articles