0 votes
by (170 points)

Using Twine2, and Harlowe:

I have a text-style change for one line for dramatic effect.  However, a longer passage follows it, and I want the text style to revert to standard after a set period of time.  In this case four seconds.  

So the following should be a delayed appearance of 2 seconds.  That works just fine.  After it displays for another two seconds, I want the text-style: "shudder" to simply be centered and bold/strong.

I'm not sure how to make that happen, however.  Here's what I've got so far.

(text-style: "shudder")[CLANG!   CLANG!   CLANG!] ]

{(live: 2s)[
	(show: ?BellRing)

Thanks in advance for any help.


1 Answer

+1 vote
by (159k points)

Please use the Question Tags to state the name and full version number of the story format you are using, as answers can vary based on this information. I will assume you are using Harlowe v2.1.0 which is the current default.

warning: There are situations where the Aligner markup doesn't always work because of this I will be using a custom named hook to center the replacement text, this requires you to add the following CSS to your project's Story Stylesheet area.

tw-hook[name="center"] {
	display: inline-block;
	min-width: 100%;
	text-align: center;

You could use a delayed (replace:) macro to replace one piece of styled text with another like so.

|alarm>[(text-style: "shudder")[CLANG!   CLANG!   CLANG!]]

Some long block of text.

(live: 2s)[
	(replace: ?alarm)[{
			(text-style: 'bold')[CLANG!   CLANG!   CLANG!]