当前位置:网站首页>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):
边栏推荐
- How to set the win10 taskbar does not merge icons
- FP7195转模拟调光技术解决智能家居调光频闪和电感噪音的原理
- 推开机电的大门《电路》(二):功率计算与判断
- CMAKE
- 基于最小二乘法的线性回归分析方程中系数的估计
- General syntax and usage instructions of SQL (picture and text)
- 设备驱动框架简介
- Impressions of Embrace Jetpack
- 实战美团Nuxt +Vue全家桶,服务端渲染,邮箱验证,passport鉴权服务,地图API引用,mongodb,redis等技术点
- 基于51单片机和物联网的智能家居系统(ESP8266物联网模块)
猜你喜欢
利用plot_surface命令绘制复杂曲面入门详解
The SSE instructions into ARM NEON
source /build/envsetup.sh和lunch)
将SSE指令转换为ARM NEON指令
小T成长记-网络篇-1-什么是网络?
FP7195降压恒流PWM转模拟调光零压差大功率驱动方案原理图
基于深度学习的配准框架
基于51单片机和物联网的智能家居系统(ESP8266物联网模块)
What is Win10 God Mode for?How to enable God Mode in Windows 10?
cmake配置libtorch报错Failed to compute shorthash for libnvrtc.so
随机推荐
CS4398音频解码替代芯片DP4398完全兼容DAC解码
推开机电的大门《电路》(一):电压,电流,参考方向
LORA芯片ASR6601支持M4内核的远距离传输芯片
Win10系统设置application identity自动提示拒绝访问怎么办
pygame绘制弧线
jest测试,组件测试
2.4G无线小模块CI24R1超低成本
jest test, component test
如何用硬币模拟1/3的概率,以及任意概率?
TCP三次握手、四次挥手
BLE蓝牙5.2-PHY6222系统级芯片(SoC)智能手表/手环
Mysql lock
FP7195转模拟恒流调光芯片在机器视觉光源的应用优势
13.56MHZ刷卡芯片CI521兼容cv520/ci520支持A卡B卡MIFARE协议
win10怎么设置不睡眠熄屏?win10设置永不睡眠的方法
机器学习---监督学习、无监督学习
Tensorflow常用函数
将SSE指令转换为ARM NEON指令
7. How to add the Click to RecyclerView and LongClick events
用U盘怎么重装Win7系统?如何使用u盘重装系统win7?