Answers for "screen class for pygame"

4

python pygame screen example

import pygame
background_colour = (255,255,255)
(width, height) = (300, 200)
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption('Tutorial 1')
screen.fill(background_colour)
pygame.display.flip()
running = True
while running:
  for event in pygame.event.get():
    if event.type == pygame.QUIT:
      running = False
Posted by: Guest on April-29-2020
0

how to make a screen in pygame

so here i will be giving the most basic and most easy method

import pygame
# initialize pygame
pygame.init()
screen = pygame.display.set_mode((1370, 710))
#1370,710 gives a full screen
Posted by: Guest on June-09-2021

Python Answers by Framework

Browse Popular Code Answers by Language