I have this code:
import pygame
class Tile(pygame.sprite.Sprite):
def __init__(self, pos, groups):
super().__init__(groups)
self.loaded_image = pygame.image.load('Folder/MyImage.png') # I added an image and I want to
self.image = pygame.Surface((64, 64)) # <------------------------ add it here
In simple words, I have a pygame.Surface
and I want to change the pygame.Surface
's value to my self.loaded_image
. Is it possible? Because usually pygame.Surface
just displays a plain block and you can fill it with only plain colors, but instead of a plain block, I want it to be a custom image. How?