R
R
Roma Kotolup2021-05-06 16:16:48
Python
Roma Kotolup, 2021-05-06 16:16:48

How to use pygame and pgu together in python?

How to use pygame and pgu together in python?
I created a pygame window like this:

import sys
import ctypes
from random import *
import time
import tkinter as tk
from PIL import ImageGrab
import os
print(os.getcwd())
FPS = 60
W = 700  # ширина экрана
H = 300  # высота экрана
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
BLUE = (0, 70, 225)
BLACK = (0, 0, 0)
RED = (220, 0, 0)
DARKGRAY = (40, 40, 40)
PURPLE = (120, 0, 120)
BROWN = (148, 19, 19)
ORANGE = (255, 179, 0)
pg.init()
t1 = time.time()
clock = pygame.time.Clock()
camera = bool(int(input()))
if camera == True:
    sc = pygame.display.set_mode((W, H))
else:
    sc = pygame.display.set_mode((W, H), pygame.FULLSCREEN)
while 1:
    sc.fill((110, 180, 110))
    for i in pygame.event.get():
        if i.type == pygame.QUIT:
            pygame.quit()
            sys.exit()
    keys = pygame.key.get_pressed()
    pressed = pygame.mouse.get_pressed()
    pos = pygame.mouse.get_pos()
    pygame.display.update()
    pygame.time.delay(20)
    clock.tick(FPS)

And how to add a pgu window to a window?
And I also have a question:
Can you draw in pygame when you add pgu to pygame?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question