Quantcast
Channel: Answers for "generate GUIText at runtime C#"
Browsing latest articles
Browse All 6 View Live

Answer by DajBuzi

http://docs.unity3d.com/Documentation/ScriptReference/GUI.Label.html private bool displayLabel; void OnMouseEnter(){ displayLabel = true; } void OnMouseExit(){ displayLabel = false; } void OnGUI(){...

View Article



Answer by robertbu

You can use AddComponent(). This code creates a new game object, add a GUIText component, centers the text on the screen (because GUIText uses Viewport coordiantes), and sets the text: #pragma strict...

View Article

Answer by Xelnath

Alternatively: GameObject g = new GameObject(); Canvas canvas = g.AddComponent(); canvas.renderMode = RenderMode.WorldSpace; CanvasScaler cs = g.AddComponent(); cs.scaleFactor = 10.0f;...

View Article
Browsing latest articles
Browse All 6 View Live




Latest Images