当前位置:网站首页>pygame draw arc
pygame draw arc
2022-08-02 15:26:00 【Tianshan has no longevity tea】
The function for drawing arcs in pygame is as follows:
pygame.draw.arc(surface, color, rect, start_angle, stop_angle, width)Parameters that need to be passed in:
- surface: canvas (screen)
- color: color
- rect: The rectangle where the arc is located
- start_angle: The starting angle of the arc (0~2 in radians
) - stop_angle: arc stop angle (0~2 in radians
) - width: The default is 1 (when ≤0, nothing is drawn)
Among them, rect, start_angle and stop_angle are more difficult to understand.First of all, rect is a rectangle defined in pygame. The definition method is Rect(left, top, width, height) , which is defined by a tuple of 4 numbers. The meanings of each number are as follows, respectivelyThe coordinates of the upper left corner, the width and height of the rectangle:

We first make an inscribed circle or ellipse in the rectangle Rect (red dotted ellipse in the figure), and then combine start_angle and stop_angle to define our arc (thick red line in the figure):

边栏推荐
- SQL的通用语法和使用说明(图文)
- Win10系统设置application identity自动提示拒绝访问怎么办
- Win10 can't start WampServer icon is orange solution
- 利用plot_surface命令绘制复杂曲面入门详解
- Win11 computer off for a period of time without operating network how to solve
- source /build/envsetup.sh和lunch)
- 实战美团Nuxt +Vue全家桶,服务端渲染,邮箱验证,passport鉴权服务,地图API引用,mongodb,redis等技术点
- pygame绘制弧线
- flink+sklearn——使用jpmml实现flink上的机器学习模型部署
- win11一直弹出用户账户控制怎么解决
猜你喜欢
随机推荐
Binder机制(中篇)
一篇文章彻底理解Redis的持久化:RDB、AOF
基于深度学习的配准框架
Win11声卡驱动如何更新?Win11声卡驱动更新方法
mysql的索引结构为什么选用B+树?
cmake配置libtorch报错Failed to compute shorthash for libnvrtc.so
HAL框架
win10无法直接用照片查看器打开图片怎么办
Fast advanced TypeScript
CS4398音频解码替代芯片DP4398完全兼容DAC解码
golang之GMP调度模型
Please make sure you have the correct access rights and the repository exists. Problem solved
二叉树遍历之后序遍历(非递归、递归)入门详解
Win10电脑需要安装杀毒软件吗?
Mysql之MVCC
PyTorch②---transforms结构及用法、常见的Transforms
Win10上帝模式干嘛的?Win10怎么开启上帝模式?
基于最小二乘法的线性回归分析方程中系数的估计
机器学习和深度学习中的梯度下降及其类型
日常-笔记
)








