One , Using text requires importing a method freetype
Specific methods
pygame.freetype.Font(“C:\Windows\Fonts\ Fangzheng thick black song simplified style .ttf”,24)
The former represents the font type , The latter represents the font size
Font type in computer c disc Windows >>fonts Under the document
import pygame,sys import pygame.freetype pygame.init() pos=[150,150] GOLD=255,
251,0 BLACK=0,0,0 screen=pygame.display.set_mode((600,400)) pygame.display.
set_caption(" Draw text ") f1=pygame.freetype.Font("C:\Windows\Fonts\ Fangzheng thick black song simplified style .ttf",24)
f1rect=f1.render_to(screen,pos," world peace , Thank you for your attention ",fgcolor=GOLD,bgcolor=BLACK,) while
True: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit()

©2019-2020 Toolsou All rights reserved,
Digital rolling lottery program Keras Save and load model (JSON+HDF5) Remember once EventBus Project issues caused by memory leaks I've been drinking soft water for three years ? What is the use of soft water and water softener msf Generate Trojan horse attack android mobile phone Time conversion front desk will 2020-07-17T03:07:02.000+0000 Into 2020-07-17 11:07:02 Chuan Shen 1190 Reverses the substring between each pair of parentheses leetcodehive Summary of processing methods for a large number of small files SparkSQL Achieve partition overlay write Image format conversion