Guest User

Untitled

a guest
Feb 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. self.rect = image.get_rect()
  2.  
  3. class SpriteSheet(object):
  4. sprite_sheet = None
  5. def __init__(self, file_name):
  6. self.sprite_sheet = pygame.image.load(file_name).convert()
  7. def get_image(self, x, y, width, height):
  8. image = pygame.Surface([width, height]).convert()
  9. image.blit(self.sprite_sheet, (0, 0), (x, y, width, height))
  10. image.set_colorkey(( 0, 0, 0))
  11. return image
Add Comment
Please, Sign In to add comment