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.

|BellRing)[=><=
(text-style: "shudder")[CLANG!   CLANG!   CLANG!] ]

{(live: 2s)[
	(show: ?BellRing)
	(stop:)
]}

Thanks in advance for any help.

---kpatrickwv

1 Answer

+1 vote
by (154k 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)[
	(stop:)
	(replace: ?alarm)[{
		|center>[
			(text-style: 'bold')[CLANG!   CLANG!   CLANG!]
		]
	}]
]

 

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...