當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python turtle.shapesize用法及代碼示例

用法:

turtle.shapesize(stretch_wid=None, stretch_len=None, outline=None)
turtle.turtlesize(stretch_wid=None, stretch_len=None, outline=None)

參數

  • stretch_wid- 正數
  • stretch_len- 正數
  • outline- 正數

返回或設置筆的屬性 x/y-stretchfactors 和/或輪廓。將調整大小模式設置為“user”。當且僅當 resizemode 設置為 “user” 時, turtle 將根據其拉伸因子拉伸顯示:stretch_wid 是垂直於其方向的拉伸因子,stretch_len 是其方向的拉伸因子,outline 確定寬度形狀的輪廓。

>>> turtle.shapesize()
(1.0, 1.0, 1)
>>> turtle.resizemode("user")
>>> turtle.shapesize(5, 5, 12)
>>> turtle.shapesize()
(5, 5, 12)
>>> turtle.shapesize(outline=8)
>>> turtle.shapesize()
(5, 5, 8)

相關用法


注:本文由純淨天空篩選整理自python.org大神的英文原創作品 turtle.shapesize。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。