Jump to content
Search Community

Image sequence with canvas

Luis Correia
Moderator Tag

Recommended Posts

Posted

Hello,

 

I need to create an image sequence with a seamless repeat animation. I already have a structure for this sequence using the canvas element, but there seems to be an issue when the animation repeats itself. The first and last frame are displayed for half the time they should. 

 

Thanks in advance for the help.

 

 

See the Pen abeMMqG by fcppsgmz-the-selector (@fcppsgmz-the-selector) on CodePen.

Posted

Hi Rodrigo,

 

Thank you for your reply.
 

Maybe the example was not the best. I updated so it shows the actual images that i'll be using.

 

Your suggestion didn't fix the issue, now it adds a delay at the end and the first one is still faster.

 

Every shadow is displayed for half a second, expect the last and the first one where they are noticeably faster (about double the speed)

 

See the Pen eYqommr by fcppsgmz-the-selector (@fcppsgmz-the-selector) on CodePen.

Posted

That's just a logic thing. Once the value gets to 0.5, it would round to 1. That's why the first and last are acting differently for you. 

 

Maybe use steps() ease like this?:

See the Pen LYwvVyx?editors=0010 by GreenSock (@GreenSock) on CodePen.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...