How to draw a border around a sprite or image in pygame?
问题 I'd like to draw a red border around an image, but can't figure out how. I've tried to fill the image of the Hero sprite and set the colorkey to red self.image.set_colorkey(red) , but that makes the image invisible. Drawing a red rect onto the image, just filled it completely: pygame.draw.rect(self.image, red, [0, 0, width, height]) . I just want a red border that will help with collision detection in the future. The code in main.py : import pygame from pygame import * import sprites from