Answers for "pygame change window size"

4

how to make a resizable pygame window

import pygame

surface = pygame.display.set_mode((350, 250), pygame.RESIZABLE)

for event in pygame.event.get():
	if event.type == pygame.VIDEORESIZE:
      surface = pygame.display.set_mode((event.w, event.h), pygame.RESIZABLE)
Posted by: Guest on October-25-2020
3

pygame get screen width and height

#pygame
w, h = pygame.display.get_surface().get_size()

#w = width
#h = height
Posted by: Guest on April-30-2021

Python Answers by Framework

Browse Popular Code Answers by Language