Jump to content
Search Community

"Sprite" animation

Samuele test
Moderator Tag

Recommended Posts

Hey @Samuele,

 

The Dude sprite is ok: width 2000 px, 10 pics.

 

So for your setup you probably need:

 

.viewer {
  height: 100%;
  margin-left: auto;
  margin-right: auto;
  width: calc(2000px / 10); // !!!
  background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/210284/doodle-sprite.png");
  background-repeat: no-repeat;
  background-position: 0 50%;
}

 

Happy tweening ...

Mikel

 

  • Like 2
Link to comment
Share on other sites

Brilliant! I shifted the code to my project and it works.
Just one more thing, to achieve more "smoothness" between frames should I edit this property:
 

ease: "steps(" + frame_count + ")",

 The steps feels too marked.

Link to comment
Share on other sites

There's no transition between frames. A stepped ease jumps between 'steps' - the number of steps map to the number of photos in the sprite.

https://greensock.com/docs/v3/Eases

If you want to fade between the images you'll need to create a timeline instead and fade between each step.

If you want to create a smoother looking sequence, you need more photos

  • Like 2
Link to comment
Share on other sites

You can't really 'transition' smoothly between two photos you see. It's either going to be one photo or the next photo. The best you can do is crossfade.

If you want the animation to look 'eased' or more 'smooth' you need to physically add more frames, sprites are a lot like traditional hand drawn animation.
 


 

  • Like 3
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...