Open GrandSchtroumpf opened 1 year ago
Is there a reason you need LinearAnimation
? The latest guidance is to use LinearAnimationInstance
and StateMachineInstance
when using the low-level runtime APIs. I think in the next major version we'll want to sunset the LinearAnimation
and StateMachine
classes so as not to make a confusing developer experience on which to use.
More here: https://help.rive.app/runtimes/overview/web-js/low-level-api-usage
I need it to get the workStart
, workEnd
and fps
values.
ng-rive
has a riv-player
component that enables you advance the linear animation
For example:
<canvas riv="poison-loader" width="500" height="500">
<riv-player #player="rivPlayer" name="idle" [time]="time"></riv-player>
</canvas>
<input type="range" step="0.1" (input)="time = $event.target.value" [min]="player.startTime" [max]="player.endTime" />
Here we can get the startTime
& endTime
derived from the workStart
& workEnd
.
When you say you want to sunset the LinearAnimation
do you mean removing it from the bindings or not exposing it as a type ?
In the type the
LinearAnimationInstance
has properties likeworkStart
orworkEnd
, which are not accessible once we instantiate the class with theLinearAnimation
. https://github.com/rive-app/rive-wasm/blob/master/js/src/rive_advanced.mjs.d.ts#L402It would be better to differentiate the
LinearAnimation
provided in the constructor, which has these properties, from theLinearAnimationInstance
.It might be the same problem with the
StateMachine
&StateMachineInstance