📌  相关文章
📜  如何在 pygame 中更改窗口颜色 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:44.721000             🧑  作者: Mango

代码示例1
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