Hello all, pfm2001 here.
I'm curious if it's at all possible to make Twine automatically format certain text? I'm trying to make it so each time a certain character's name is mentioned, that it will be their color, such as "Did you hear about Steve? I heard he and Alex get along very well."
I'm wondering because it's very tedious to keep typing "(color: #33CCCC)[ROBOT EXTRAORDINAIRE] and the like.
My sincerest thanks for reading this post, and especially if you have an answer.
Comments
Place the following in a footer tagged passage, you can name the passage whatever you want but you should make it something simple because you will need to use it within a CSS select later on. The name I used in this example was style-names.
note: The documentation of the (text-color:)/(color:) macro states that the CSS colour is a String and therefor should be wrapped in quotes. ... add a (replace:) macro for each of the names you want to be coloured.
You can use the following CSS to stop the footer tagged passage adding unwanted line-breaks to the bottom of the current passage, if you named your footer passage something other than style-names then you will need to alter the CSS selector to include the name you used instead.
Then when you want to use the name, just <<$steve>> (or, if you have sugarcube, $steve)
This will work when you have both Alex and Alexander on screen at the same time.