Hi, How do I make a text label remove after certain seconds (in UI) and be replaced with a new one? I need to show a caption of a story, but only one sentence at a time. Any thoughts?
@LtgGames Hmm, it looks like you don't need to remove the label but only to replace its content; probably you can't do that only using default nodes in BB3 but this can be easily done with a simple custom node, a possible setup could be something like: Timer node > Custom node > Set UI Text node Here's an example: Here's the script content: let counter = 0; function signal(name, value, sender, source){ if (value){ let text = ''; counter += 1; switch (counter){ case 1: text = 'Hello adventurer!'; break; case 2: text = 'What brings you here?'; break; case 3: text = 'This is a dangerous place!'; break; } this.emitSignal('Out', text); } } This is the simplest solution I could find; make sure to set 'Time' and 'Number of events' attributes in the timer node, for examples if you have 3 sentences you can set the number of events to 4 so after the last sentence is shown it gets removed when the timer triggers for the 4th time.
it's a brilliant suggestion @Ivan Perfetti , but since it's a caption, the sentence needs to have different seconds. I.e. "Hello adventurer" holds for 6 seconds, "What brings you here?" in 4 seconds, etc... It seems like I need to have the same longness of the sentence with the timer-solution...
Why wouldn’t you just use the Set Visible node. Add a delay node and toggle the visibility of the line of text when you want it to appear.
Yeah, thought of that... but: where to connect the visible node? And it's easy to make it invisible, but the problem is to make the label first invisible before the "set visibility"-node sets it to visible...
There you go! Just updated it so that you can set a specific time for each sentence, you can add pauses between sentences and you can show multiple lines adding a line feed (\n), you can see everything in the attached demo bbdoc (make sure you rename it to remove the .zip extension).