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

边栏推荐
- DP4056电源保护芯片锂电池pin对pinTP4056
- Failed to install using npx -p @storybook/cli sb init, build a dedicated storybook by hand
- Bash shell位置参数
- Actual combat Meituan Nuxt +Vue family bucket, server-side rendering, mailbox verification, passport authentication service, map API reference, mongodb, redis and other technical points
- 使用npx -p @storybook/cli sb init安装失败,手把手搭建专属的storybook
- win10任务栏不合并图标如何设置
- STM32F1和F4的区别
- 使用 腾讯云搭建一个个人博客
- Win10电脑不能读取U盘怎么办?不识别U盘怎么解决?
- Configure clangd for vscode
猜你喜欢
随机推荐
ASR6601牛羊定位器芯片GPS国内首颗支持LoRa的LPWAN SoC
cmake配置libtorch报错Failed to compute shorthash for libnvrtc.so
vscode镜像
系统线性、时不变、因果判断
pygame拖动条的实现方法
IPV4和IPV6是什么?
FP7122降压恒流内置MOS耐压100V共正极阳极PWM调光方案原理图
Win10无法连接打印机怎么办?不能使用打印机的解决方法
FP6296锂电池升压 5V9V12V内置 MOS 大功率方案原理图
A clean start Windows 7?How to load only the basic service start Windows 7 system
MATLAB绘制平面填充图入门详解
Tensorflow常用函数
利用plot_surface命令绘制复杂曲面入门详解
【使用Pytorch实现VGG16网络模型】
What is Win10 God Mode for?How to enable God Mode in Windows 10?
Win10电脑不能读取U盘怎么办?不识别U盘怎么解决?
Spark及相关生态组件安装配置——快速回忆
DP1332E刷卡芯片支持NFC内置mcu智能楼宇/终端poss机/智能门锁
深入理解Golang之Map
设备驱动框架简介
)








