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

Disable animations when Scene is in paused state. #69

Open
fitzmode opened this issue Jun 23, 2020 · 3 comments
Open

Disable animations when Scene is in paused state. #69

fitzmode opened this issue Jun 23, 2020 · 3 comments

Comments

@fitzmode
Copy link

fitzmode commented Jun 23, 2020

I have some elemens in a Scene, and I would like to have the animations applied only when Scene is playing.
The scenario is the elements can be moved around to adjust their positions before the Scene is played.
The problem then is some elements may be offscreen before they are actually played, making an editing use case tedious to implement and depends on a lot of conditional code.

Is there a simple way of conditionally setting the css transforms only when the Scene | SceneItem in a playing state.

Scene({...}, {
...,
disabled: true
})
@daybrush
Copy link
Owner

@fitzmode

What does this mean?

The problem then is some elements may be offscreen before they are actually played, making an editing use case tedious to implement and depends on a lot of conditional code.

Is it certain that a specific item is in a delayed state while it is playing?

@fitzmode
Copy link
Author

@daybrush Consider a div with SceneItem properties of transform: translate(-400px, 50px) relative to a parent div and a duration of 1 second i.e the div is initially out of view if the parent has overflow hidden .

To be able to use a Moveable on it, one would need to progress the timeline to the specific time the SceneItem finishes. My question is, is there a way to disable the application of SceneItem properties when it is paused, to allow for manipulation of elements, then reapply SceneItem properties on play event.

@daybrush
Copy link
Owner

daybrush commented Jul 1, 2020

@fitzmode
Well not yet. If what I think is correct, I wonder if it can work with this code.

const frame = item.newFrame(time);

frame.set(....);



// ...
item.update();

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