mixtur / webpack-spritesmith

Webpack plugin that converts set of images into a spritesheet and SASS/LESS/Stylus mixins
499 stars 56 forks source link

How to generate an animated sprite (GIF) out of animated GIFs? #85

Closed EasterPeanut closed 5 years ago

EasterPeanut commented 5 years ago

I can only get the generated GIF sprite to be static. Is there a way to have it animated?

mixtur commented 5 years ago

Never checked this. This may work though:

new SpritesmithPlugin({
  target: {
    ...,
    image: path.resolve(__dirname, 'path/to/spritesheet.gif'
  },
  ...
  spritesmithOptions: {
    engine: require('gmsmith')
  }
})

If it will not work I don't think I'll be able to do anythinhg else.

EasterPeanut commented 5 years ago

If it will not work I don't think I'll be able to do anythinhg else.

Hm, too bad, I tried that already, but this will render the layers of the animated gifs on top of each other in the generated sprite.

I guess it's not very common to generate animating sprites anyway tho

mixtur commented 5 years ago

I can imagine two reasons why you would want that.