Pygame error: Tuple has no get_size () attribute

I've tried everything I can think of to get this background to work, this is the closest I've gotten as it doesn't break any other bits of my code. I'm not sure why get_size () isn't working.

gameDisplay = pygame.display.set_mode = ((display_width, display_height))
myFont = pygame.font.SysFont("monospace", 15)
pygame.display.set_caption("Catastrophee")
background = pygame.Surface(gameDisplay.get_size())
background = background.convert()

      

This is just a piece of code. I have defined all the variables correctly.

Please help, thanks Cam.

+3


source to share


3 answers


Maybe this helps?



gameDisplay = pygame.display.set_mode((display_width, display_height)) #removed =
myFont = pygame.font.SysFont("monospace", 15)
pygame.display.set_caption("Catastrophee")
background = pygame.Surface(gameDisplay.get_size())
background = background.convert()

      

+2


source


gameDisplay = pygame.display.set_mode((display_width, display_height))

      



Just remove second = from this line

+3


source


You must:

gameDisplay=pygame.display.set_mode([screen_width,screen_height])

      

Not

gameDisplay = pygame.display.set_mode = ((display_width, display_height)) 

      

+1


source







All Articles