Game Development Reference
In-Depth Information
//copy character by character into the 3D lines
//look for spaces to break sentence
var lineCount = 0;
for(var i = 0; i < original.length; i++)
{
if((lastTweet[lineCount].text.length +
(original.IndexOf(" ",i)—i)) <
lineLength ||
(lastTweet[lineCount].text.length >=
lineLength &&
original[i] != " "))
{
lastTweet[lineCount].text += original[i];
}
else
{
lineCount++;
lastTweet[lineCount].text += original[i];
}
//if we've run out of lines quit writing
if(lineCount > = lastTweet.length)
return;
}
}
function Start()
{
//get users last message
var www : WWW = new WWW (twitterTextURL);
//wait for data from twitter
yield www;
var hash=JSON.ParseJSON(www.text);
for (var item : DictionaryEntry in hash)
{
DivideLines(25, item.Value["text"]);
}
//get users profile image
var www1 : WWW = new WWW (twitterPictureURL);
//wait for data from twitter
yield www1;
//put profile image onto plane
serImage.renderer.material.mainTexture = www1.texture;
}
Search Nedrilad ::




Custom Search