Is there a way to toggle trough multiple text endlessly?

Hi there!

Im new to programming and Coblocks, i’m trying to do something what must be really simple.

I try to do view different text on every click on an object. I got this to work but i want the text to start over at the first text so you can toggle trough the text endlessly.

Is there a way to do this?

This is what i got now:

Screen Shot 2020-08-20 at 11.58.55

Hi @Willemijn_van_arnhem,

The best way to do it is to create a list of phrases, store the position of the current phrase and when the object is clicked, increase the position and say the corresponding phrase.

The code could be following:

I create a CoSpace for you, feel free to remix it and explore the code.

Hope that helps

aaa thanks! I’m sure that’s gonna help :smiley:

Is there a way to add parameters for the text in the list in a function?

I see the text-item in the parameter-list, but this is the item-text not the text i want to change.

think this must be possible very easy :see_no_evil:

You could use list of lists. And store in a list a list with text item and text.
For example, first parameter of inner list could be phrase and second - who should pronounce it.

1 Like