Ren'Py Sprite Sheet Animations
A downloadable script
Download NowName your own price
Generate animations from sprite sheets!
    This script includes a function (spritesheet_animation) that
    creates animations from given sprite sheet files.
  
Example
spritesheet_animation("images/explosion.png", 8, 6)
| Status | Released | 
| Category | Other | 
| Rating | Rated 5.0 out of 5 stars(1 total ratings) | 
| Author | Foxcapades | 
| Made with | Ren'Py | 
| Tags | Animation, Open Source, Ren'Py, sourcecode, Sprites | 
| Code license | MIT License | 
Download
Download NowName your own price
Click download now to get access to the following files:
Download from GitHub 
External

Comments
Log in with itch.io to leave a comment.
Code is a lil deprecated with new renpy versions.
Replace
hold_last_frame = bool(kwargs["hold_last_frame"]) if "hold_last_frame" in kwargs else False with renpy.open_file(image_path) as handle: full_width, full_height = __get_image_size(handle) sprite_width = int(full_width / x_sprite_count)
With
hold_last_frame = bool(kwargs["hold_last_frame"]) if "hold_last_frame" in kwargs else False full_width, full_height = renpy.image_size(image_path) sprite_width = int(full_width / x_sprite_count)
Thank you for the comment! And sorry for the incredibly late reply.
The
renpy.image_sizefunction was intentionally ignored for efficiency reasons. The renpy builtin loads and unpacks the full file without making use of any caching. The__get_image_sizefunction only reads the first couple dozen bytes of the file to fetch the width and height from the metadata.For the use case, I felt that it would be unnecessarily costly to load, decompress, then throw away an image of unknown size just to get at a couple of ints.
If renpy adds a similar method that does make use of image caching, that would the preferable option.