当前位置:网站首页>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):
边栏推荐
猜你喜欢
随机推荐
基于深度学习的配准框架
CI24R1小模块2.4G收发模块无线通信低成本兼容si24r1/XN297超低功耗
Please make sure you have the correct access rights and the repository exists.问题解决
FP7122降压恒流内置MOS耐压100V共正极阳极PWM调光方案原理图
【深度学习中的损失函数整理与总结】
Daily - Notes
MATLAB图形加标注的基本方法入门简介
机器学习---监督学习、无监督学习
【我的电赛日记(完结)---2021全国大学生电子设计竞赛全国一等奖】A题:信号失真度测量装置
蓝牙温度检测系统(基于BT08-B蓝牙模块)
编译error D8021 :无效的数值参数“/Wextra” cl command line error d8021 invalid numeric argument ‘/wextra‘
source /build/envsetup.sh和lunch)
Win10 cannot directly use photo viewer to open the picture
vscode镜像
实战美团Nuxt +Vue全家桶,服务端渲染,邮箱验证,passport鉴权服务,地图API引用,mongodb,redis等技术点
ARMv8虚拟化
How to add a one-key shutdown option to the right-click menu in Windows 11
为vscode配置clangd
TCP三次握手、四次挥手
FP6296锂电池升压 5V9V12V内置 MOS 大功率方案原理图