I'm using things like <<timedreplace>> and <<timedcycle>> to change text around--to do stuff with speech cadence and blinking and stuff like that, and I'm running into a problem where Twine is ignoring spaces. (I'm getting the sense this is some arcane--read: stupid--code-related reason.)
In other words, imagine a motel sign with a broken NO VACANCY sign: The V and the A bulbs are flickering. In theory, this should work:
<<timedcycle .3s>>NO VACANCY<<becomes>>NO CANCY<<endtimedcycle>>
Essentially, this code is going to alternate the sign between the two states; there are three spaces between "NO" and "CANCY" in the second one. I'm using a fixed-width font, so the latter two spaces should be in the place of the VA.
However, Twine is ignoring the three spaces and giving me only a single space: In other words, it's just outputting "NO CANCY"--one space in between. So my question is, how do I get Twine to realize that I'm not just adding spaces in for my health?
A workaround involves inline CSS. The following *looks* how I want it to:
@color:transparent;VA@
@CANCY<<endtimedcycle>>
This does come off as somewhat ugly and clumsy, but it works, and it might be the most elegant solution that's available at the moment. Anyway, if anyone has any ideas or insight about the spacing issue, I'd appreciate it. Thanks!
Comments
I think the problem lies in HTML and not in twine as 'ignoring the whitespace' behavior is 'by design' of the HTML. I would suggest using non-breaking spaces to solve your issue:
<<timedcycle .3s>>NO VACANCY<<becomes>>NO CANCY<<endtimedcycle>>
With Regards,
Binary Adder
As an aside, I think the effect you want would look a little classier if you did this: