Skip to main content
3mo ago

Dynamic Text Change in State Machine by Input

Hi everyone!

I'm trying to find a way to change the text run in State Machine by input.

What I want to achieve is to change the number on icon depending on the number of notification (finally I want to implement it to the mobile app)

I'm thinking of using text run in timeline to have options from 1 to 99, and then bring it to the state machine, but I don't know how to control the number by input, or even if it's possible. Is there any way to achieve this result?

or it would also be great if it is possible to bind the text from the app using the actual data.

Thanks for your help in advance.

3 replies
3mo ago

As far as I know, you have two options in the current version of the Rive Editor/Runtime:

1) Editor: Create 99 timelines, one for each number, and use a number input as the condition to transition from an Any State to respective number of notifications. This is a very fiddly process so make sure it is really worth it.
2) Runtime: Export the name of your text run so that the developer can access it and change it directly through code. More on this here: https://rive.app/community/doc/text/docn2E6y1lXo

3mo ago

Thank you! I thought about the 1st option but did not want to go for it because of the reason you said.
It's good to hear that it con be controlled by code. I'll talk to developers:)

3mo ago

Can you have dynamic text on nested artboards?