Appending a line with some of the text coloured.

General discussion about the Genesis Web Client located at https://www.genesismud.org/play/

Moderator: Eowul

Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Post Reply
Callimachus
Greenhorne
Posts: 6
Joined: 06 May 2019 03:42

Appending a line with some of the text coloured.

Post by Callimachus » 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.

Post Reply
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/