用法:
turtle.screensize(canvwidth=None, canvheight=None, bg=None)
- canvwidth:- 正整數,畫布的新寬度(以像素為單位)
- canvheight:- 正整數,畫布的新高度(以像素為單位)
- bg:- 顏色字符串或color-tuple,新的背景顏色
參數:
如果沒有給出參數,則返回當前(canvaswidth,canvasheight)。否則調整 turtle 正在繪製的畫布的大小。不要更改繪圖窗口。要觀察畫布的隱藏部分,請使用滾動條。使用這種方法,可以使以前在畫布之外的繪圖部分可見。
>>> screen.screensize() (400, 300) >>> screen.screensize(2000,1500) >>> screen.screensize() (2000, 1500)
例如尋找錯誤逃脫的 turtle ;-)
相關用法
- Python turtle.screensize()用法及代碼示例
- Python turtle.speed()用法及代碼示例
- Python turtle.shapesize用法及代碼示例
- Python turtle.setworldcoordinates()用法及代碼示例
- Python turtle.shape()用法及代碼示例
- Python turtle.setx()用法及代碼示例
- Python turtle.settiltangle()用法及代碼示例
- Python turtle.shape用法及代碼示例
- Python turtle.setup用法及代碼示例
- Python turtle.shapetransform()用法及代碼示例
- Python turtle.sety用法及代碼示例
- Python turtle.speed用法及代碼示例
- Python turtle.settiltangle用法及代碼示例
- Python turtle.stamp用法及代碼示例
- Python turtle.setundobuffer()用法及代碼示例
- Python turtle.showturtle()用法及代碼示例
- Python turtle.shapetransform用法及代碼示例
- Python turtle.stamp()用法及代碼示例
- Python turtle.shearfactor()用法及代碼示例
- Python turtle.setx用法及代碼示例
注:本文由純淨天空篩選整理自python.org大神的英文原創作品 turtle.screensize。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。