Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types: LinearAnimation vs LineraAnimationInstance #286

Open
GrandSchtroumpf opened this issue Feb 7, 2023 · 2 comments
Open

Types: LinearAnimation vs LineraAnimationInstance #286

GrandSchtroumpf opened this issue Feb 7, 2023 · 2 comments

Comments

@GrandSchtroumpf
Copy link
Contributor

In the type the LinearAnimationInstance has properties like workStart or workEnd, which are not accessible once we instantiate the class with the LinearAnimation.
https:/rive-app/rive-wasm/blob/master/js/src/rive_advanced.mjs.d.ts#L402

It would be better to differentiate the LinearAnimation provided in the constructor, which has these properties, from the LinearAnimationInstance.

It might be the same problem with the StateMachine & StateMachineInstance

@zplata
Copy link
Contributor

zplata commented Feb 14, 2023

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

@GrandSchtroumpf
Copy link
Contributor Author

GrandSchtroumpf commented Feb 14, 2023

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants