1.绝对坐标
可以使用turtle.goto(x,y)方法来让海龟沿着绝对坐标进行运动
以屏幕中间为原点(0,0),形成四象限的坐标体系。
python的turtle库认识和学习(4)之海龟位置(turtle.goto())
2.含义
turtle.goto(0,300)#代表x为0,中心向上300,y为300
turtle.goto(-100,100)#代表X为-100,代表向左100,y为100,代表向上100
turtle.goto(100,-100)#代表x为向右100,y为向下100

3.例子
t.penup()
t.goto(0,300)#设置写字的位置,字的位置为屏幕中心向上300的位置
t.color(“green”)
t.write(“我爱你中国”, font=(‘Arial’, 20, ‘normal’))#屏幕上写字“我爱你中国”。

图:
python的turtle库认识和学习(4)之海龟位置(turtle.goto())
完成。

相关文章:

  • 2022-02-21
  • 2022-01-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-01
  • 2021-08-25
  • 2022-12-23
猜你喜欢
  • 2021-08-25
  • 2021-12-29
  • 2021-10-08
  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
相关资源
相似解决方案