def text_objects(text, color, size="small"):
smallfont = pygame.font.SysFont("comicsansms", 26)
if size == "small":
textSurface = smallfont.render(text, True, color)
def screen_message(msg, color, y_displace=0):
textSurf, textRect = text_objects(msg, color)
textRect.center = (int(display_width / 2), int(display_height / 2) + y_displace)
gameDisplay.blit(textSurf, textRect)
Это та часть кодов, в которой у меня ошибка
Ошибка говорит,
строка 74, в game_intro screen_message («Добро пожаловать на Титанов!», Белый, -100)
что составляет screen_message("Welcome to Titans!", white, -100)
строка 52, в screen_message textSurf, textRect = text_objects (msg, color)
TypeError: объект 'NoneType' не повторяется
Я не понимаю ошибку, почему речь идет о NoneType