pygame-spritesheet

Python pygame extension that provides SpriteSheet class.


Keywords
pygame, sprites, sheet, spritesheet, lightweight, simple
License
MIT
Install
pip install pygame-spritesheet==0.2.0

Documentation

travis-ci.com codacy.com license

pygame-spritesheet

This is a lightweight sprite sheet implementation for pygame.

Usage

Install pygame-spritesheet using pip:

pip install pygame-spritesheet
import pygame
from pygame import Color as Colour
from spritesheet import SpriteSheet, Origin

# load a sprite sheet that has 12 columns and 12 rows of sprites
# with magenta colour key for transparency
sprites = SpriteSheet("sprites.png", columns=12, rows=12, colour_key=Colour(255, 0, 255))

#...

# blit your sprites onto a surface
sprites.blit(surface, sprite_id, position=(x, y), origin=Origin.TopLeft)

Documentation

As of now, there's none. This package has a single class. Please read docstrings.

Please also check out this minimal example.

This might change in the future.