蟒蛇形状 [英] Python turtle shapes

查看:30
本文介绍了蟒蛇形状的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用 python 龟画一些东西,我使用了形状函数,但形状在它们之前覆盖了其他形状(我可以看到形状在移动),我只得到最后一个形状:

I am drawing something with python turtle , i used the shape functions but the shapes overdraw the others before them (i can see the shapes moving) , and i get just the last shape:

`up()
goto(-200,-200)
down()
shape("circle")
shapesize(2,1,1)
fillcolor("black")
up()
goto(-300,-100)
down()
shape("circle")
shapesize(4,4,1)
fillcolor("black")
up()
goto(-100,-100)
down()
shape("circle")
shapesize(4,4,1)
fillcolor("black")`

期待您的回答,谢谢!

推荐答案

turtle.shape 在绘制时更改海龟的形状.要实际绘制该形状,您需要 turtle.戳():

turtle.shape changes the shape of the turtle as it's drawing. To actually draw that shape where it is, you need turtle.stamp():

up()
goto(-200,-200)
down()
shape("circle")
shapesize(2,1,1)
fillcolor("black")
stamp()
up()
goto(-300,-100)
down()
shape("circle")
shapesize(4,4,1)
fillcolor("black")
stamp()
up()
goto(-100,-100)
down()
shape("circle")
shapesize(4,4,1)
fillcolor("black")
stamp()

这篇关于蟒蛇形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆