- Home /
Finding the height of a text asset.
Hey everyone. Im using a textasset for some terms and conditions. Then sorta realised that I don't know to ref its height which I need to get an appropriate sized scrollview. Anyone have any ideas on how to solve this? PS: It's a .txt if that makes a difference?
EDIT: Also noticed that the text asset is only showing half its content... just cuts of about half way. Checked the document. It's all there. Anyone ever hear of this happening either?
the source of you text isn't as important as how you're trying to display it which you haven't told us.
try posting your current code or, at the very least, some additional info about how you're trying to do it - for example, are you using the 4.6 ui???
scrollview = GUI.BeginScrollView (new Rect(0,raise*2,scrW+indent,raise*16), scrollview, new Rect(0, 0, 0,scrH*12));
GUI.Label (new Rect(0,0,0,scrH*12),asset.text,inco$$anonymous$$gGUIStyle);
GUI.EndScrollView ();
I've tried using text area as well ins$$anonymous$$d of label. EDIT: scrH is screen.height. I just times it by 12 so I could see the Terms display. What I'm trying to do is turn that scrH*12 into asset.text.height.
Answer by iwaldrop · Jun 28, 2016 at 09:55 AM
Is this in game or the editor?
if editor, just leave it as a readme.
if in-game, I'd format it as html and use Application.OpenURL