【问题标题】:How to add a specific part of an image in pygame?如何在pygame中添加图像的特定部分?
【发布时间】:2018-11-24 08:53:48
【问题描述】:

我想在 pygame 中加载图像的特定部分。 我该怎么做? 我有一个不同角度的人物形象。在 SDL 中我们使用 rect,但是在 pygame 中我们有这个选项吗?

【问题讨论】:

标签: pygame pygame-surface


【解决方案1】:

https://www.pygame.org/docs/ref/surface.html#pygame.Surface.blit 使用surface.blit(source, dest, area=None, special_flags = 0))。 area 参数将允许您放置要绘制的图像的哪个部分的矩形

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-02-02
    • 2014-06-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-13
    相关资源
    最近更新 更多