Appending a line with some of the text coloured.
Posted: 14 Aug 2019 05:36
I'm tryin to append a line to my screen output, with specific colour for a portion of it. Unfortunately, my simple brain can't seem to get it to work.
A silly example to show the sort of thing I'm trying to do:
If I inventory my backpack, I might get a few lines like:
32 copper coins
83 silver coins
So, say I want to add a line to the output after the silver coins lines such as:
32 copper coins
83 silver coins
need gold coins -- get some
Adding the extra line is easy enough. The problem I'm having is I would like to colour one or more words in that extra line, but not the entire line. So, output 'gold coins' in yellow, leaving the rest in the default colour. I don't want to use gwc.output.replace because I'm not replacing anything. I'm using gwc.output.append, but I can't seem to get colour inserted in there without the actual code I'm trying printing out as well.
I realize this is probably a simple thing, but I hope someone can help me out anyway.
A silly example to show the sort of thing I'm trying to do:
If I inventory my backpack, I might get a few lines like:
32 copper coins
83 silver coins
So, say I want to add a line to the output after the silver coins lines such as:
32 copper coins
83 silver coins
need gold coins -- get some
Adding the extra line is easy enough. The problem I'm having is I would like to colour one or more words in that extra line, but not the entire line. So, output 'gold coins' in yellow, leaving the rest in the default colour. I don't want to use gwc.output.replace because I'm not replacing anything. I'm using gwc.output.append, but I can't seem to get colour inserted in there without the actual code I'm trying printing out as well.
I realize this is probably a simple thing, but I hope someone can help me out anyway.