Unity XAML Editing at Runtime
Posted: 08 Dec 2017, 16:15
I am working with NoesisGUI with Unity, and I am trying to add Run tags into an existing TextBlock at runtime. Is this possible? I am trying to get it so that specific parts of the text are certain colours and bold/italic when needed.
If it was a Grid then you could just add a Run tag to its children, but I want to do this with a TextBlock, but this does not have this option. I have tried adding the tags as you would in XAML literally as in setting its text value to:
<Run Text="whatever" Foreground="SomeColour"></Run>
But all this does is display the literal text. Any ideas?
And by the way, I did put actual colours into the Foreground property, this was just a demo of what I did
If it was a Grid then you could just add a Run tag to its children, but I want to do this with a TextBlock, but this does not have this option. I have tried adding the tags as you would in XAML literally as in setting its text value to:
<Run Text="whatever" Foreground="SomeColour"></Run>
But all this does is display the literal text. Any ideas?
And by the way, I did put actual colours into the Foreground property, this was just a demo of what I did