"""
Drawing an example happy face
If Python and Arcade are installed, this example can be run from the command line with:
python -m arcade.examples.happy_face
"""
import arcade
# Set constants for the screen size
SCREEN_WIDTH = 600
SCREEN_HEIGHT = 600
SCREEN_TITLE = "Happy Face Example"
# Open the window. Set the window title and dimensions
# 打开一个窗口,设置窗口标题和尺寸
arcade.open_window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
# Set the background color
# 设计背景颜色
arcade.set_background_color(arcade.color.WHITE)
# Clear screen and start render process
# 清除屏幕并开始渲染过程
arcade.start_render()
# --- Drawing Commands Will Go Here ---
# Draw the face
x = 300
y = 300
radius = 200
# 画一个大的圆 填充黄色
arcade.draw_circle_filled(x, y, radius, arcade.color.YELLOW)
# Draw the right eye
# 绘制一个小圆填充黑色
x = 370
y = 350
radius = 20
arcade.draw_circle_filled(x, y, radius, arcade.color.BLACK)
# Draw the left eye
# 绘制一个小圆填充黑色
x = 230
y = 350
radius = 20
arcade.draw_circle_filled(x, y, radius, arcade.color.BLACK)
# Draw the smile
# 绘制一个弧线填充黑色
x = 300
y = 280
width = 120
height = 100
start_angle = 190
end_angle = 350
arcade.draw_arc_outline(x, y, width, height, arcade.color.BLACK,
start_angle, end_angle, 10)
# Finish drawing and display the result
# 完成绘制并显示结果
arcade.finish_render()
# Keep the window open until the user hits the 'close' button
# 保持窗口打开
arcade.run()
标签:Draw,Arcade,arcade,color,笑脸,SCREEN,window,radius,绘制
From: https://blog.csdn.net/weixin_32759777/article/details/136618389