Hi, i’m tryng to insert a “carriage return” in the string i’m reading from an XML file, cause i need to specify the word wrapping in some text labels populated with the XML tags.
I find how to read the XML, and all works fine, but i need to insert line breaks special characters!
I try with \n
and various special codes starting with …but nothing seems work!
here is the code… but i think i need to modify the XML, not the code!
var myXMLFile : TextAsset;
private var myXMLString : String;
function Start(){
myXMLString = myXMLFile.text;
}
function OnGUI () {
GUI.Label (Rect (30,30,400,400), readXMLTag("myTag"));
}
function readXMLTag(myTag : String){
var tagStart : int = myXMLString.IndexOf("<"+myTag+">") + myTag.length +2;
var tagEnd : int = myXMLString.IndexOf("</"+myTag+">");
myTag = myXMLString.Substring(tagStart, tagEnd - tagStart);
return myTag;
}
TNX!