Jump to content
Search Community

SteppedEase

studioraygun test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi

 

I've searched high and low for the answer for this but no luck so far. I'm using SteppedEase to create a sprite sheet animation, but for some reason when the animation ends it flips back to the first frame. How can I make it stop at the last frame?

 

Code is very simple:

TweenMax.to(".globe__globe", 5, {backgroundPosition:'0 -67280px', ease:SteppedEase.config(145)});

Many thanks,

Matt

See the Pen vLFmd by GreenSock (@GreenSock) on CodePen

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums,

 

My suggestion for de-bugging would be to remove the tween altogether and just use css

 

.globe__globe {

background-position: 0 -67280px;

}

 

Does that give the desired result of showing the last frame?

 

Also, keep in mind, the end value should be - (widthOfSheet - widthOfFrame)

 

Feel free to plop your image in here

http://codepen.io/GreenSock/pen/vLFmd

 

Like Jack said, a simple demo goes a long way.

  • Like 2
Link to comment
Share on other sites

Thanks for your replies guys, turns out I'd started my frame count from 1 when I should have started it at 0.

 

This means that my end values were 144 frames and I had to reduce the overall height on background-position. Very frustrating but a lesson learned for future.

Link to comment
Share on other sites

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...