Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- self.rect = image.get_rect()
- class SpriteSheet(object):
- sprite_sheet = None
- def __init__(self, file_name):
- self.sprite_sheet = pygame.image.load(file_name).convert()
- def get_image(self, x, y, width, height):
- image = pygame.Surface([width, height]).convert()
- image.blit(self.sprite_sheet, (0, 0), (x, y, width, height))
- image.set_colorkey(( 0, 0, 0))
- return image
Add Comment
Please, Sign In to add comment