Мой исходный код выглядел так:
Код: Выделить всё
import pygame
import pygame.freetype
pygame.init()
pygame.display.set_caption('hello world')
screen = pygame.display.set_mode((800, 600), 0, 32)
title_font = pygame.font.Font(".../Montserrat-BlackItalic.ttf", 24)
title = title_font.render('sup', False, (250, 250, 250))
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
screen.fill((25, 25, 25))
screen.blit(title, (0, 0))
pygame.display.update()
pygame.quit()
Код: Выделить всё
File ".../untitled1.py", line 22, in
screen.blit(title, (0, 0))
TypeError: argument 1 must be pygame.Surface, not tuple
Код: Выделить всё
title_font = pygame.freetype.Font(".../Montserrat-BlackItalic.ttf", 24)
[img]https://i. sstatic.net/63n4f.png[/img]
Подробнее здесь: https://stackoverflow.com/questions/668 ... ith-pygame
Мобильная версия