Text Formatting and Text Areas

Hi,

So I love that unity allows you to just drag a text file in as an asset, then display those contents easily into a text area.

I have a couple of questions though,

a) can the text area be disabled? so that the player can’t edit the displayed text.

b) is there anyway we can perform formatting within the textfile that will then be picked up and displayed within the text area?

Thanks :slight_smile:

Hi, welcome to the forum!

On each call, changes made to the text are returned by GUI.TextArea. The resulting string has to be passed back in on the next call for the changes to be seen. To prevent editing, just ignore the returned string when you call GUI.TextArea.

Along the lines of HTML or something like that? There’s no built-in way to do this, and I can’t find anything on the Unify wiki.

Along the lines of html would have been great, but even such simple things as changing the font size, or boldness etc.

I guess it wouldn’t be hard to write a quick custom parser, but i guess it has to be possible in one form or another first.

another question, is it possible for a button in a webplayer to actually affect the website it is loaded in, for example you click a button and it changes the web address?

mainly I’m scoping out the possibility of building an actual website using the unity webplayer as i figure you could do some really cool effects to show off media etc, but then it’s kinda pointles if i can’t somehow link it to the main site forums and if i can’t easily format the text within the site.

ok, nevermind the hyperlink, I tried the search function and actually scored a hit so i’m going to experiment with that. But i’d still be interested in finding out how to format strings if its possible?

These two threads:-

http://forum.unity3d.com/viewtopic.php?t=16175
http://forum.unity3d.com/viewtopic.php?t=10175

…may be of interest.

Excellent Thank you!

The second link seems to appeal to me more so when I get some proper time at the weekend I’ll have a better look into it.

meantime domain and hosting is setup and i’m quite pleased with the results so far :smile: plain text will work for now till I have time to sort that out. Looking forward to thinking up some fun ways to display media now :smile: