python-turtle - 乌龟 onscreenclick 在 Python 中返回什么?如何使区域成为“按钮”?
问题描述
是否turtle.onscreenclick
返回 x 和 y 坐标?另外,如何制作一个矩形,如果我在其中单击会更改矩形的颜色?
解决方案
turtle.onscreenclick
将括号中的函数绑定到给定的键。
turtle.onscreenclick(fun, 1)
其中 1 是左键单击,3 是右键单击。
说明: https ://docs.python.org/3/library/turtle.html#turtle.onscreenclick
推荐阅读
- python - 在三元散点图上调整坐标轴范围和坐标轴标题位置
- list - 删除 pymongo 集合中的列表项
- c# - 添加两个具有 0.5 或 0.75 的文本框值
- javascript - 动态更新值的数学公式
- python - 套接字发送旧数据
- wpf - 如何让 Prism 和 Unity 的包依赖项工作?
- javascript - 将图像分配给不同的按钮
- java - Spring Cloud Hoxton.SR5 与 Eureka 和 WebFlux 的问题:超过了缓冲区的最大字节数限制
- c# - .Net Core 3.1 API 路由未按预期工作
- vb.net - 如何在 VB.NET 代码格式中保留空格(或对齐)?