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


Python turtle.Shape.addcomponent用法及代碼示例

用法:

addcomponent(poly, fill, outline=None)

參數

  • poly- 一個多邊形,即一對數字的元組
  • fill- 一種顏色poly將充滿
  • outline- 多邊形輪廓的顏色(如果給定)

例子:

>>> poly = ((0,0),(10,-5),(0,10),(-10,-5))
>>> s = Shape("compound")
>>> s.addcomponent(poly, "red", "blue")
>>> # ... add more components and then use register_shape()

請參閱複合形狀。

相關用法


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