When I load my image in pygame (see code below), the image appears pitch black, instead of drawing properly!
Using Python 3.12.8
import pygame
pygame.init()
def imageload(imagepath):
return pygame.image.load(imagepath)
Surface = pygame.Surface
screen = pygame.display.set_mode((300, 200), 0, 32)
pygame.display.set_caption('Python Clicker')
background_colour = (255,255,255)
cookieimage = Surface.convert(imageload('images/python.bmp'))
running = True
while running:
screen.fill(background_colour)
screen.blit(Surface((64,64), 0, cookieimage), (150, 100), None, 0)
pygame.display.flip()
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pygame.quit()
Black box in place of image.