- Home /
Break the limits on text area
I have an application that creates some specific logs of what is happening in the environment. The app runs in the web player. I wanted to allow the users to be able to see the logs and get them out of the application before they closed it down and lots the data. As it is a web app I can't write to the file system. So instead I flattened the array of items into a long string and put it in a scrolling window
scrollPosition3 = GUI.BeginScrollView (new Rect (10, ybuffer + 5, Screen.width - 120, Screen.height - ybuffer - 10), scrollPosition3, new Rect (10, ybuffer + 5, Screen.width, (currentlog+1) *20));
// Put something inside the ScrollView
GUI.TextArea (new Rect (10, ybuffer + 5, Screen.width - 120, (currentlog+1) *20), totallog);
// End the ScrollView
GUI.EndScrollView ();
However, after several thousand entries the text will no longer display all of itself. (I found a post somewhere that said the text is rendered like any other vertex objects and so it means it has too many points for a single object so it clips). This was a hacky solution anyway but did at least allow a select all cut and paste up until the clipping. Do you have any suggestions for a good way to display large amounts of text. I am sure my log file is not as large as a EULA :) I am eventually going to push the logs to a logging service probably a node.js one on the server but for now I need to try and get the text out. As I do have the items in an array in the first place I know I can page things, but it seems overkill for a simple text dump? It is a medical training application so the researchers need a lot of context logging about who did what when to what http://www.feedingedge.co.uk/blog/2013/04/26/training-in-a-virtual-hospital-zombies/