Skip to content
Sprite Animation Demo in C/SDL2. Create a spritsheet from gif.
C Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets/gfx
src
Makefile
README.md

README.md

Cheetah Animation

Running Cheetah

This is a small SDL2 Demo and it does demonstrate how to...

  • create a spritesheet from a gif
  • load that sheet
  • render the spriteframes timed

Useful links:
SDL2 SDL-Discourse Example Code

Assets
Cheetah: unknown artist.

Get in touch on SDL-Discourse

Details:

Gif is a pretty old rasterformat with some clever ideas behind, details:

Create Spritesheet:
giftext Cheetah.gif

giftext is one of 12 tools from libgif and gives the info about the delay, it is hundred milliseconds.
gifsicle is an alternative to deal with gif's.
gifsicle --info Cheetah.gif

Now ImageMagick comes into play:
Split Gif-Frames
convert -coalesce Cheetah.gif out%05d

Create Sheet:
montage out0000[0-7] -tile 4x2 -background transparent gepard_running.png

...see the rest in the source.

You can’t perform that action at this time.