Hey,
I'm using Harlowe and I want to use the transition macro to make a text constantly pulse. Now as I read the transition-time command doesn't work at all, so I made it work like this:
(set: $wub to "Wub wub wub wub wub wub wub wub wub wub")
(live: 0.6s)[(transition: "pulse")[$wub]]
I'm pretty new to coding and I can't find a way to save all those attributes to $wub. There's always an error, a string can't be saved with a value, blabla.
So is there any way to have this (live: 0.6s)[(transition: "pulse")[$wub]] or maybe this (live: 0.6s)[(transition: "pulse")[Wub wub wub]] somehow saved together as one thing?
The only thing I have managed was this:
|wub>[(live: 0.6s)[(transition: "pulse")[Wub wub wub]]]
|bam>[(live: 0.6s)[(transition: "pulse")[Bam bam bam]]]
|uz>[(live: 0.6s)[(transition: "pulse")[Uz uz uz]]]
(live: 3s)[
(replace: ?uz)[(either: ?wub, ?bam, ?uz)]]
I've played around with (either:) but it usually just ignores the (live: 0.6s)[(transition: "pulse")] completely.
And then there is the problem that even if it did work I still had those lines on top because of the named hooks.
I just want [(live: 0.6s)[(transition: "pulse") assigned to a text, and this as three different $whatever, and then swap them every 3 seconds while they keep pulsing like annoying music.
I also tried doing it by hand and without setting up anything, but it seems the different live macros are interfering with each other and also it's quite confusing. I wish it was possible the way I want it with nicely assigned variables I can just shuffle.
What I want is basically this:
(set: $wub to (live: 0.6s)[(transition: "pulse")[Wub wub wub])
{(live:3s)[
(either: $wub, $uz, $Bam)
]}
Despite the fact I can't manage to put this [(live: 0.6s)[(transition: "pulse")[Wub wub]] line in one $whatever.
Please help.
Comments
warning: You may want to get a more experienced CSS coder to look at the following in case it is incorrect or contains incompatibilities.
note: All the following CSS should be placed within your Story Stylesheet area, accessed via the Edit Story Stylesheet menu item.
As far as I know you can't assign a (live:) macro to a $variable but you can place it within a child passage which can then be included within a different passage using the (display:) macro.
I have problems getting Harlowe's pulse transition to work, so I suggest you create your own animation effect.
A animation is generally made up of two parts:
a. The visual effect.
In your case you want the text to change it's scale (to pulsate) and the following CSS defines a pulsate class which can be assign to a HTML element. ... the above keyframe is very basic and only changes the scale between two values.
b. The control.
This controls things like the duration of the effect, how many times the effect occurs, how the effect starts and stops, etc...
The following CSS defines a short-infinite class which causes any effect it is associated with to last for three seconds and loop for ever. note: you could also add the above CSS directly to the pulsate class but then if you wanted to use different control values for different text you would need to create overriding classes.
You can use the above two CSS classes (pulsate and short-infinite) like so:
Now to combine all of the above with a (live:) macro which allows the text to be changed while the animation effect is doing its thing.
"As far as I know you can't assign a (live:) macro to a $variable but you can place it within a child passage which can then be included within a different passage using the (display:) macro."
Guess I know what you mean. Gotta try it.
I placed this in a passage:
And in the other ones
etc., depending on names of course.
Now I can display the parent passage somewhere and it switches the "music". The only problem now is that with every time it switches, the rest of the text in the window where it is displayed gets pushed down.
And another question. In the Harlowe manual it says:
I don't get the part with $var. What can I write instead of what? I can use a child passage like a variable? I didn't figure out what to type to do so.
Edit: Okay...maybe my bad. In the online editor it does work. I'm using the download version of Twine for a while because the online editor kept being down one day.
Wonder why it is like this.
Please do not mark this comment.