admin管理员组文章数量:1123598
I'm using Rive in my Flutter app for animations. I have a main artboard with a nested artboard called "mouth." I want to access the inputs (hear and sad) from both artboards, but I'm having trouble with the nested artboard's inputs.
Here’s my code:
RiveAnimation.asset(
RiveAsset.RG,
artboard: 'Artboard',
fit: BoxFit.contain,
onInit: onRiveInit,
);
SMIInput<bool>? hearInput;
SMIInput<bool>? sadInput;
void onRiveInit(Artboard artboard) {
final controller = StateMachineController.fromArtboard(
artboard,
'main',
);
if (controller != null) {
artboard.addController(controller);
hearInput = controller.findInput<bool>('hear'); // Input from the main artboard
sadInput = controller.findInput<bool>('sad'); // Input from the nested artboard
}
}
The issue is that while hearInput (from the main artboard) works correctly, sadInput (from the nested artboard) does not work with the findInput method. How can I access inputs from a nested artboard in Rive?
版权声明:本文标题:How do I call the inputs of nested artboard 'mouth' used in my main artboard in flutter? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736581513a1944956.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论