I noticed this in the new new UI manual, but nothing related in it seems to work and their example is for the legacy system.
http://docs.unity3d.com/Manual/StyledText.html
My main question is can you color or in any way style text in the new UI without changing all text in the text box?
What do you man with
Do you mean change the color of the whole text or edititng the text content?
The Rich Text works fine with the new gui, you even enable / disable the Rich Text on the text component.
Or use assets like TextMeshPro and others
But as @fffMalzbier says, the Text control supports the same RichText (xml style) system that the legacy GUI did. (provided you enable it on the text)
@fffMalzbier I am talking about using things like <color=#00ffffff>This is Colored to just color certain words or segments in the UI, the manual link I posted supposedly is for the new UI, it is posted under it, but none of the tags in the table seem to work in the new UI, and seem to only work in the scripted UI (legacy).
I have double checked this, and none of the tags work, it just prints them as regular text in the box.
Odd because it works for me.
I’d suggest creating a sample project and submitting it as a bug using the Unity bug reporter in the editor in that case
Not sure if you got this sorted yet, but I found a small bug and that is you must have at least one character after the closing brace (so a space if you have no other text to enter)
I did get this working…sort of.
I can now use <color=green> for example but I can only use it once, if I try to use it more than once per Text component/Object, it simply prints the text <color=green> in the text box.
This is working fine, perhaps you have some formatting problems with your text? Are you inputting it in the field directly or inputting something from code?
This formats properly:
<color=red><i>Red Italic</i></color> <color=green>and Green</color>
You must close rich text segments in the same order that they are opened or none of it will compile.
I am more than familiar with HTML and CSS so I know this, but I am still having this problem.
Can you post the text you’re using, or a repro scene? Does the line I posted work for you?
Very odd, It seems to work so long as I don’t put too much text in, after I go over about 40 words it stops working.
Maybe I should reinstall Unity or something, definitely looks like something has gone wrong, I have never tried it with little text before so didn’t notice.
It’s working fine for me. Are you positive you aren’t introducing some formatting errors somewhere as the field gets bigger and more populated?
<color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>, <color=red><b>Red</b></color>, <color=green><i>Green</i></color>, <color=blue><b><i>Blue</i></b></color>,
I just coppied and pasted this into a Text component on my UI, and I get the same thing that would appear when Rich Text is disabled, but it isn’t. I have tested this on my laptop and it works fine, I am thinking it may be my installation.
Interesting… at least we’ve narrowed it down.
I had a similar problem. For me, it worked when I removed blank space.
Not working:
<color = blue>Blue!
Working:
<color=blue>Blue!
As per the Unity Manual
https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/StyledText.html
Tag parameters cannot include blank spaces. For example:
We are <color = green>green with envy
does not work because of the spaces to either side of the = character.