Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

gui with pygame

import pygame


 pygame.init()

 pygame.display.set_caption('Quick Start')
 window_surface = pygame.display.set_mode((800, 600))

 background = pygame.Surface((800, 600))
 background.fill(pygame.Color('#000000'))

 is_running = True

 while is_running:

     for event in pygame.event.get():
         if event.type == pygame.QUIT:
             is_running = False

     window_surface.blit(background, (0, 0))

     pygame.display.update()
Source by pygame-gui.readthedocs.io #
 
PREVIOUS NEXT
Tagged: #gui #pygame
ADD COMMENT
Topic
Name
1+4 =