当前位置:网站首页>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):

边栏推荐
- 为vscode配置clangd
- jest test, component test
- How to solve Win11 without local users and groups
- FP7126降压恒流65536级高辉无频闪调光共阳极舞台灯RGB驱动方案
- 推开机电的大门《电路》(一):电压,电流,参考方向
- Win11电脑一段时间不操作就断网怎么解决
- How to set the win10 taskbar does not merge icons
- FP6195耐压60V电流降压3.3V5V模块供电方案
- Win10电脑不能读取U盘怎么办?不识别U盘怎么解决?
- 【我的电赛日记(完结)---2021全国大学生电子设计竞赛全国一等奖】A题:信号失真度测量装置
猜你喜欢
随机推荐
How to update Win11 sound card driver?Win11 sound card driver update method
Please make sure you have the correct access rights and the repository exists. Problem solved
Spark及相关生态组件安装配置——快速回忆
MATLAB图形加标注的基本方法入门简介
define #使用
Do Windows 10 computers need antivirus software installed?
Bash shell位置参数
发布模块到npm应该怎么操作?及错误问题解决方案
机器学习和深度学习中的梯度下降及其类型
ECP2459耐压60V降压BUCK电路用于WIFI模块供电方案原理图
Use tencent cloud builds a personal blog
PyTorch①---加载数据、tensorboard的使用
MATLAB制作简易小动画入门详解
Win10 cannot directly use photo viewer to open the picture
实战美团Nuxt +Vue全家桶,服务端渲染,邮箱验证,passport鉴权服务,地图API引用,mongodb,redis等技术点
cmake配置libtorch报错Failed to compute shorthash for libnvrtc.so
A clean start Windows 7?How to load only the basic service start Windows 7 system
How to set the win10 taskbar does not merge icons
Win10安装了固态硬盘还是有明显卡顿怎么办?
FP5139电池与适配器供电DC-DC隔离升降压电路反激电路电荷泵电路原理图
)








