【问题标题】:pygame.font.SysFont() takes about 5 seconds on macOSpygame.font.SysFont() 在 macOS 上大约需要 5 秒
【发布时间】:2021-01-31 06:50:33
【问题描述】:

我正在使用pygame 2.0.0.dev15 使用 Python 开发游戏。到目前为止一切都很好,但我很惊讶pygame.font.SysFont() 需要大量时间来处理。

每当我在游戏中使用字体时,启动时间都会比不使用字体多 5 秒。我使用的字体数量似乎并没有减慢它的速度——这只是第一个pygame.font.SysFont() 调用这样做。肯定有问题。我在 macOS Catalina 上,使用 Python 3.8.6。

当我改用pygame.font.Font() 时,问题就消失了。

为什么pygame.font.SysFont() 需要这么多时间?

【问题讨论】:

标签: python fonts pygame pygame2


【解决方案1】:

这是因为不同的操作系统有不同的速度。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-10-16
    • 2018-03-31
    • 2019-02-12
    • 2023-04-05
    • 1970-01-01
    • 1970-01-01
    • 2017-01-22
    • 1970-01-01
    相关资源
    最近更新 更多