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

Animations should allow you to specify the total duration #1892

Closed
eonarheim opened this issue May 8, 2021 · 1 comment · Fixed by #2065
Closed

Animations should allow you to specify the total duration #1892

eonarheim opened this issue May 8, 2021 · 1 comment · Fixed by #2065
Labels
Hacktoberfest Issues marked for the community Hacktoberfest event https://hacktoberfest.digitalocean.com/

Comments

@eonarheim
Copy link
Member

Context

Currently you need to specify the individual frame duration, in order to specify the total duration some math is required to calculate based on the number of frames. We should support a convenient way of specifying a total duration.

Proposal

const anim = new ex.Graphics.Animation({
   totalDuration: 2000, // in ms
});

If totalDuration is specified, then frameDuration should be ignored.

@github-actions
Copy link

github-actions bot commented Jul 8, 2021

This issue hasn't had any recent activity lately and is being marked as stale automatically.

@github-actions github-actions bot added the stale This issue or PR has not had any activity recently label Jul 8, 2021
@eonarheim eonarheim added Hacktoberfest Issues marked for the community Hacktoberfest event https://hacktoberfest.digitalocean.com/ and removed stale This issue or PR has not had any activity recently labels Oct 1, 2021
eonarheim pushed a commit that referenced this issue Oct 23, 2021
…on (#2065)

Closes #1892 

## Changes:

- `ex.Animation` now support `totalDuration` that will calculate automatically each frame duration based on how many frames have.
- Added a Storybook to check the behavior visually of the `frameDuration` property
- Added a Storybook to check the behavior visually of the `totalDuration` property
- Included the test to validate this new functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest Issues marked for the community Hacktoberfest event https://hacktoberfest.digitalocean.com/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant