“Pygame BG Farbe” Code-Antworten

So ändern Sie die Fensterfarbe 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
solo_programmer

Pygame BG Farbe

while running:
    for i in pygame.event.get():
        if i.type == pygame.QUIT:
            running = False
            pygame.quit()

    screen.fill(currentColor) # Fill the screen with whatever the stored color is. 

    pygame.display.update() # Refresh the screen, needed whatever the color is, so don't remove this
Handsome Hummingbird

Ähnliche Antworten wie “Pygame BG Farbe”

Fragen ähnlich wie “Pygame BG Farbe”

Weitere verwandte Antworten zu “Pygame BG Farbe” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen