Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

How can I make a new line in Unity UI text?

$
0
0
Hello. How can I make a new line in Unity UI text? I tried many methods, but every time I have no results. This is the code: void Start() { StartCoroutine(Check()); TextGameObject.text = "Press The Quotes Button"; } public void SwitchText(){ QuoteToShow = lineArray [Random.Range (0, lineArray.Length)]; TextGameObject.text = QuoteToShow; } private IEnumerator Check() { WWW w = new WWW("http://site.com/quotes.txt"); yield return w; if (w.error != null) { Debug.Log("Error .. " +w.error); textFromServer = textFromLocal; lineArray = textFromServer.Split("\n"[0]); } else { Debug.Log("Found ... ==>" +w.text +"<=="); textFromServer = w.text; lineArray = textFromServer.Split("\n"[0]); } } And this is the text that I want to be on different lines: “ Start by doing what's necessary, "\n" then do what's possible, \n and suddenly you are doing the impossible. ” \r\n\r\n - Francis of Assisi - “ The best and most beautiful ; things in the world cannot be ; seen or even touched, they must be felt with the heart. ” \n\r ; - Helen Keller - This text is located in "quotes.txt"

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>