用法:
turtle.setworldcoordinates(llx, lly, urx, ury)
- llx:- 一個數字,畫布左下角的 x 坐標
- lly:- 一個數字,畫布左下角的 y 坐標
- urx:- 一個數字,畫布右上角的 x 坐標
- ury:- 一個數字,畫布右上角的 y 坐標
參數:
設置用戶定義的坐標係並在必要時切換到模式“world”。這將執行
screen.reset()
。如果模式“world” 已激活,則根據新坐標重新繪製所有圖紙。注意:在用戶定義的坐標係中,角度可能會出現扭曲。
>>> screen.reset() >>> screen.setworldcoordinates(-50,-7.5,50,7.5) >>> for _ in range(72): ... left(10) ... >>> for _ in range(8): ... left(45); fd(2) # a regular octagon
相關用法
- Python turtle.setworldcoordinates()用法及代碼示例
- Python turtle.setx()用法及代碼示例
- Python turtle.settiltangle()用法及代碼示例
- Python turtle.setup用法及代碼示例
- Python turtle.sety用法及代碼示例
- Python turtle.settiltangle用法及代碼示例
- Python turtle.setundobuffer()用法及代碼示例
- Python turtle.setx用法及代碼示例
- Python turtle.setheading用法及代碼示例
- Python turtle.seth()用法及代碼示例
- Python turtle.sety()用法及代碼示例
- Python turtle.speed()用法及代碼示例
- Python turtle.shapesize用法及代碼示例
- Python turtle.shape()用法及代碼示例
- Python turtle.screensize用法及代碼示例
- Python turtle.shape用法及代碼示例
- Python turtle.shapetransform()用法及代碼示例
- Python turtle.speed用法及代碼示例
- Python turtle.stamp用法及代碼示例
- Python turtle.showturtle()用法及代碼示例
注:本文由純淨天空篩選整理自python.org大神的英文原創作品 turtle.setworldcoordinates。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。