Common Arcade Library Functions
Overview
The following documents some of the common Arcade library functions that may come in handy for your projects. You are encouraged to refer back to the library's documentation for a more complete list.
To use any of the functions from the arcade library you will need to import it:
import arcade
Drawing
The complete list of drawing functions are found here. Click on any of the function names to see a detailed explanation of all of the values you can pass to those functions as well as some examples of how to use them.
Here is an example that draws a solid (filled) circle:
# This code puts the circle at the position: x = 50, y = 100
# It has a radius of 20, and is green.
arcade.draw_circle_filled(50, 100, 20, arcade.color.GREEN)
And here is an example that draws a solid (filled) rectangle:
# This code creates a rectangle with a center at: x = 25, y = 50.
# It has a width of 30 and a height of 15, and is black.
arcade.draw_rectangle_filled(25, 50, 30, 15, arcade.color.BLACK)
Colors
You may have noticed that there is a list of predefined colors you can use for drawing. A complete list is found here.
To use one of the colors from the list, you reference it by specifying arcade.color
before the name of the color as follows:
arcade.color.CHERRY_BLOSSOM_PINK