Is there any way to resize a gif shape with turtle in Python?

后端 未结 2 2006
南方客
南方客 2021-01-27 03:16

I\'m using turtle to make a little game and realized I could use image files with turtle.registershape(filename). I know you can resize the default shapes with

2条回答
  •  梦谈多话
    2021-01-27 03:36

    The answer is no. I went through the source code of cpython library and tracked to the draw image method call. See _drawturtle method of cpython library, where drawImage method is called with no information of variables like pensize or shapesize. I agree with @cdlane that you will have to use other resize using other libraries, however one tip, if you know beforehand the set of image sizes you will need, you can generate them and load during the game start instead of resizing at the runtime.

提交回复
热议问题