Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to change the window colour in pygame

import pygame
pygame.init() #initialize pygame
SCREEN_WIDTH = 600 # width (in px)
SCREEN_HEIGHT = 800 # height (in px)

WIN = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) # creates a screen of 600px X 800px
RED_VALUE = 255 # should be from 0 - 255
GREEN_VALUE = 255 # should be from 0 - 255
BLUE_VALUE = 255 # should be from 0 - 255
while True:
	pygame.display.update() # updates the screen
    WIN.fill(RED_VALUE,GREEN_VALUE,BLUE_VALUE) # this is going to be white in color
Comment

PREVIOUS NEXT
Code Example
Python :: fetch python 
Python :: python namedtuple 
Python :: kivy changing screen in python 
Python :: turn of warning iin python 
Python :: sum all values of a dictionary python 
Python :: python swap 0 into 1 and vice versa 
Python :: vsc python close all functions 
Python :: get every nth element in list python 
Python :: python number with comma to float 
Python :: python version command notebook 
Python :: plt close all 
Python :: neural network import 
Python :: pygame left click 
Python :: python convert html to text 
Python :: actual keystroke python 
Python :: python if else short version 
Python :: python how to get alphabet 
Python :: what is a good python version today 
Python :: reload is not defined python 3 
Python :: how to get the code of a website in python 
Python :: python datetime time in seconds 
Python :: python watchgod 
Python :: python reverse string 
Python :: get index pandas condition 
Python :: get cpu count in python 
Python :: internet explorer selenium 
Python :: add header to table in pandas 
Python :: django template datetime-local 
Python :: how to save array python 
Python :: grassmann formula 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =