gpt4 book ai didi

pygame - 如何更改 pygame 中的字体对象大小

转载 作者:行者123 更新时间:2023-12-03 09:20:27 26 4
gpt4 key购买 nike

我有这些代码

FONT = pygame.font.Font("font/calibri.ttf", 50)
FONT.size = 25

但是编译器说

AttributeError: 'pygame.font.FONT' object attribute 'size' is read-only

我发现没有方法可以帮助我更改大小。我怎样才能做到这一点?

最佳答案

您无法更改现有 Font 对象的大小。您必须创建一个具有所需大小的新 Font 对象。

关于pygame - 如何更改 pygame 中的字体对象大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32687080/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com