0 votes
by (310 points)

Hiya! 

I'm using Harlowe 2.1.0 / Twine 2.2.1

I have a link (which is already styled via my stylesheet),which displays some text in the link itself. The link is a link to performing an action, which I want to have associated with costing two different attributes (in this case, willpower and stamina). I'd like the willpower cost to display blue and the stamina cost to display red, in the link text. Is that possible? 

(set:$willpower_cost to 1)

(set:$stamina_cost to 2)

(set:$text to "Fight back: " + (text:$willpower_cost) + " " + (text:$stamina_cost"))

(link:$text)[

{stuff happens here} 

]

1 Answer

+1 vote
by (1.1k points)

It looks like you can just put markup inside the link text. at least this works for me in Twine 2.1.3 / Harlowe 2.0.1:

(set:$text to "Fight back: (color: blue)[" + (text:$willpower_cost) + " willpower] (color:red)[" + (text:$stamina_cost) + " stamina]")

(link:$text)[{stuff happens here}]

The colors override the link styling, so if your links are marked only by color (no underline or font weight or anything) it won't be obvious that the costs are part of the link (the mouse cursor will probably change, but the text won't).

...