rive-flutter icon indicating copy to clipboard operation
rive-flutter copied to clipboard

Use Artboard Size Not Exposed

Open neilresniksonos opened this issue 3 years ago • 1 comments

Description

<-- A clear and concise description of what the problem is. --> The Rive class has a nice useArtboardSize parameter to make sure the widget will have an inherent size in case the parents have infinite dimensions. Unfortunately this parameter does not appear to be publicly exposed, to set it you must re-implement RiveAnimation (and more importantly _RiveAnimationState). Am I missing something?

neilresniksonos avatar Apr 29 '22 21:04 neilresniksonos

I also was wondering if there was a way for state machines to not replay the animation if I recreate the widget displaying the state machine (a Rive widget) with the same controller. As of right now, it replays the transition animation from the entry state to the existing state, instead of doing no extra animations because it re-initialized even though the state didn't change, and unlike with a basic animation, I can't easily override the init call on the StateMachineController class to work around this issue. Do you have any suggestions on how to achieve this? I tried overriding the advanceInputs call to do nothing for a single call (to avoid it being called from the init) with no luck, and also setting it to not be active also does nothing. It always replays the animation as it initializes with the new Artboard, even though the controller and animation are the exact same.

neilresniksonos avatar May 04 '22 21:05 neilresniksonos

Hi @neilresniksonos,

Apologies for this issue going unnoticed. useArtboardSize has been added to RiveAnimation since v0.11.6.

Going to close this issue, but if you're still encountering difficulties with your other question please feel free to open a separate issue describing the difficulties. If you could share a code sample that will be helpful.

HayesGordon avatar Aug 10 '23 12:08 HayesGordon