Текст не выводится на экран Pygame при нажатии кнопки - PullRequest
0 голосов
/ 03 февраля 2020

Я хочу закодировать очень простую программу, которая выводит текст на экран пигме при нажатии кнопки, но по какой-то причине он не выводится при нажатии кнопки. Любая помощь? Спасибо.

import pygame
red = (255,0,0)
green = (0,255,0)
blue = (0,0,255)

X=800
Y=480

pygame.init()
pygame.font.init()
my_screen = pygame.display.set_mode((800, 480) , 
pygame.RESIZABLE)
my_font = pygame.font.Font('freesansbold.ttf' , 36)
text = my_font.render("Please wait, loading...",True,green)
textRect=text.get_rect()
textRect.center = (X // 2, Y //2)
pressed=False
boxThick=[0,10,10,10,10,10]
still_looping =True
while still_looping:
  for event in pygame.event.get():
    if event.type==pygame.QUIT:
      still_looping=False


  pygame.draw.rect(my_screen,(0,255,0),(0,0,200,200),boxThick[0])
  pygame.draw.rect(my_screen,(50,50,50),(200,200,100,50),0)

  a,b,c = pygame.mouse.get_pressed()
  if a:
    pressed = True
  else:
    if pressed == True:
      x,y = pygame.mouse.get_pos()
      if x> 200 and x<300 and y>200 and y<200:
               my_screen.blit(text,textRect)
               pressed = False


  pygame.display.update()
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...