✅ Solved: Override items of nested artboard?
I’m new to Rive, so maybe I’m missing something, so please let me know! Also, I’m specifically working with the Defold game engine, if that makes any difference.
I want to make a simple “Main Menu” with just a few buttons - “New Game”, “Load Game”, “Settings”, and “Credits”. I’ve watched tons of videos and tutorials and I’ve seen 3 main ways of doing this so far:
No nested artboard — just make 4 buttons all with the same style, add whatever text you need to each button, and make 4 sets of button controls and animations in the state machine. This isn’t really desirable, because if I want to change the style of the buttons, I have to duplicate the work 4 times over
Create a “Button” artboard, and make all the button controls only once. Then just add another animation layer with a separate animation for each button text. When you nest the button artboard, you can just play a different animation for each button to make their text appear correctly. This is better than option 1, but on the main artboard, your buttons will all have the same text until you push play.
Create a “Button” artboard, same as method 2, but instead of animations, you can use databinding to set the text run to whatever text you want. This also has the same issue as with method 2, where you don’t see the result until you push play. Also when I export it to Defold, the inital data binding doesn’t carry over, so even when I run the scene in the game, it only shows the original text on the artboard, not the data-bound text. This may very well be a bug on the Defold side though.
What was I hoping for? I was hoping you could create an artboard, and then nest it several times in the main artboard, and just override the text run in each button. But it doesn’t seem like there’s any way to do this. Am I missing something? Or should I write this as a feature request? I’m thinking of it similar to the concept of “prefabs” in many game engines, where you can define the prefab, and then reuse it multiple times and override various properties as necessary.
Thanks in advance!